FILE() - Problems with blanks or umlauts

Harbour, MingW related news.

Moderator: Rathinagiri

Post Reply
hkrasser
Posts: 16
Joined: Fri Jul 10, 2009 12:08 pm
Location: Austria

FILE() - Problems with blanks or umlauts

Post by hkrasser »

Hello!

In former Versions of HMG the function 'FILE()' worked even if the filenames included blanks or umlauts.
With HMG 3.2 it does not work, this means the result is always .F. even if the file "Verbrauchsmaterial für COAGUCHECK.pdf" exists

LOCAL cFile:="Verbrauchsmaterial für COAGUCHECK.pdf"

IF FILE(cFile)
MsgInfo( cFile + " is there", Version() )
ELSE
MsgInfo( cFile + " is NOT there", Version() )
ENDIF

Maybe anyone has an idea to solve this problem?
:D
Attachments
krasser.zip
(31.24 KiB) Downloaded 515 times
Javier Tovar
Posts: 1275
Joined: Tue Sep 03, 2013 4:22 am
Location: Tecámac, México

Re: FILE() - Problems with blanks or umlauts

Post by Javier Tovar »

Hello hkrasser,

Yes, I also found problems with the umlaut, it did not happen in this version.

regards
User avatar
Pablo César
Posts: 4059
Joined: Wed Sep 08, 2010 1:18 pm
Location: Curitiba - Brasil

FILE() - Problems with blanks or umlauts

Post by Pablo César »

hkrasser wrote:In former Versions of HMG the function 'FILE()' worked even if the filenames included blanks or umlauts.
Hi Krasser, in first: FILE() is Harbour not HMG !

And for me works PERFECTLY !!

I took your same code above and I compiled in CONSOLE mode (pure Harbour) and also I made in GUI and there is not problem at ALL !!!

See files attached yourself can recompile in HMG version 3.2 and see. (I also attached my exe file).

Probably my firend you are not editing in UTF-8. When I took your german phrase into the prg gave me same error than you, but I saw my editor (Notepad++) was not in UTF-8. As you should know, UNICODE is perfectly works very well with languages, but you need to write in UNICODE mode, otherwise NEVER is gonna work.

When you pass to UTF-8 mode (Encoding menu item), you will se your source code with all german accents, will be changed for strange chararcters. The please, re-type your text and save it.

Also when you use function to check if exist, copy, all these kinf of OS proposes like as: IF FILE, COPY FILE, HB_DirExists, DirMake... always IS good to put full path name too. This makes easier and safe.
Attachments
Teste70.rar
(847.76 KiB) Downloaded 533 times
HMGing a better world
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein
Javier Tovar
Posts: 1275
Joined: Tue Sep 03, 2013 4:22 am
Location: Tecámac, México

Re: FILE() - Problems with blanks or umlauts

Post by Javier Tovar »

Hola Pablo César,

Si, efectivamente es como dices, yo lo había hecho pero no lo hice correctamente ya que hay dos menus uno dice "Codificar en UTF-8" y otro dice "Convertir en UTF-8" y debe de ser en este último. Ya que el archivo ya esta hecho!

Saludos
User avatar
Pablo César
Posts: 4059
Joined: Wed Sep 08, 2010 1:18 pm
Location: Curitiba - Brasil

FILE() - Problems with blanks or umlauts

Post by Pablo César »

Hola Javier,

Solo tienes que ponerlo en UTF-8 como muestra la figura:
Tela.PNG
Tela.PNG (30.72 KiB) Viewed 10325 times
Image

Please note, just to select in Enconding menu Item for UTF-8.
HMGing a better world
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein
Javier Tovar
Posts: 1275
Joined: Tue Sep 03, 2013 4:22 am
Location: Tecámac, México

Re: FILE() - Problems with blanks or umlauts

Post by Javier Tovar »

Gracias Pablo César,

Ya lo compile y ya carrio! :D

Saludos

////////////////////////////////////////////////////////////////////////////////////////////////////////

Thanks Pablo César,

You'll compile and already carrio! :D

regards
Post Reply