Page 1 of 1

FILE() - Problems with blanks or umlauts

Posted: Tue May 06, 2014 5:33 pm
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

Re: FILE() - Problems with blanks or umlauts

Posted: Tue May 06, 2014 5:56 pm
by Javier Tovar
Hello hkrasser,

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

regards

FILE() - Problems with blanks or umlauts

Posted: Tue May 06, 2014 8:05 pm
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.

Re: FILE() - Problems with blanks or umlauts

Posted: Tue May 06, 2014 9:17 pm
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

FILE() - Problems with blanks or umlauts

Posted: Tue May 06, 2014 9:59 pm
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 3527 times
Image

Please note, just to select in Enconding menu Item for UTF-8.

Re: FILE() - Problems with blanks or umlauts

Posted: Wed May 07, 2014 12:06 am
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