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

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 71 times

Javier Tovar
Posts: 1274
Joined: Tue Sep 03, 2013 4:22 am
Location: Tecámac, México
Has thanked: 1 time
Been thanked: 2 times

Post by Javier Tovar » Tue May 06, 2014 5:56 pm

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
Has thanked: 100 times
Been thanked: 177 times

Post by Pablo César » Tue May 06, 2014 8:05 pm

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 105 times
HMGing a better world
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein

Javier Tovar
Posts: 1274
Joined: Tue Sep 03, 2013 4:22 am
Location: Tecámac, México
Has thanked: 1 time
Been thanked: 2 times

Post by Javier Tovar » Tue May 06, 2014 9:17 pm

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
Has thanked: 100 times
Been thanked: 177 times

Post by Pablo César » Tue May 06, 2014 9:59 pm

Hola Javier,

Solo tienes que ponerlo en UTF-8 como muestra la figura:
Tela.PNG
Tela.PNG (30.72 KiB) Viewed 1509 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: 1274
Joined: Tue Sep 03, 2013 4:22 am
Location: Tecámac, México
Has thanked: 1 time
Been thanked: 2 times

Post by Javier Tovar » Wed May 07, 2014 12:06 am

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