Page 1 of 2

File with German Umlaute -> Directory() ?

Posted: Mon Oct 05, 2020 3:44 am
by AUGE_OHR
hi,

i have a File with "ü" CHR(129) which ist a German "Umlaut"
i use UNICODE and DIRECTORY() to get Array for GRID
German_Umlaute.jpg
German_Umlaute.jpg (51.02 KiB) Viewed 2113 times
i did not notice this before unter harbour / HMG :shock:
i know this from Xbase++ that DIRETORY() under GUI will return ANSI .. how about HMG :?:

Re: File with German Umlaute -> Directory() ?

Posted: Mon Oct 05, 2020 6:15 pm
by AUGE_OHR
hi

here Sample file
how to show it :idea:
Demo_UTF8.ZIP
(127.04 KiB) Downloaded 114 times

Re: File with German Umlaute -> Directory() ?

Posted: Tue Oct 06, 2020 2:28 am
by AUGE_OHR
hi,

when i ZIP Demofile i got this Warning from Total Commander
UniCode_Codepage.jpg
UniCode_Codepage.jpg (62.22 KiB) Viewed 2027 times
what does "Codepage" for a Image mean ... or is it just "?" in Filename :?:

---

i can´t RENAME / FRENAME() it and also SH-Operationen (ala Explorer) fail (with Side-Effect)
i can use Explorer, which show it right, to edit (F2) Filename

so how with HMG Unicode Version :idea:

Re: File with German Umlaute -> Directory() ?

Posted: Tue Oct 06, 2020 8:05 am
by edk
Hi Jimmy, your sample file is correctly listed with Directory() using UNICODE, but wrong with DEWIN and DE850. Other files created by me containing the character ü are listed correctly in all three coding pages.
Bez tytułu.png
Bez tytułu.png (44.81 KiB) Viewed 2003 times
The file names returned by the Directory() function are encoded in the same code page as set in run time.
In your case, I suggest that you use the UTF8 encoding page to list files and folders.

Re: File with German Umlaute -> Directory() ?

Posted: Tue Oct 06, 2020 3:42 pm
by AUGE_OHR
hi,

THX for help, i will look at your Sample.

i have to check it but i "think" i do no set any Codepage, only when open DBF ... hm ... perhaps FMSetup.DBF

Re: File with German Umlaute -> Directory() ?

Posted: Tue Oct 06, 2020 6:00 pm
by edk
AUGE_OHR wrote: Tue Oct 06, 2020 3:42 pm hi,

THX for help, i will look at your Sample.

i have to check it but i "think" i do no set any Codepage, only when open DBF ... hm ... perhaps FMSetup.DBF
You can check current CP by msgdebug ( hb_cdpSelect() )

Re: File with German Umlaute -> Directory() ?

Posted: Tue Oct 06, 2020 10:30 pm
by AUGE_OHR
You are right.
i have set Codepage at Startup (HBFM.PRG)

after change Codepage all look fine
but now i have Problem with FreeImage to load file

Code: Select all

   bError := ERRORBLOCK( { | oErr | BREAK( oErr ) } )
   BEGIN SEQUENCE
      nType := FREE_GetFileType( cPath + cFile, 0 )
      nFreeHandle := FREE_Load( nType, cPath + cFile, 0 )
   END SEQUENCE
   ERRORBLOCK( bError )

   IF EMPTY( nFreeHandle )
      Msginfo( "Error loading : " + cPath + cFile )
      RETURN nil
   ENDIF
i got Error and no Handle from FreeImage :shock:
after Error FreeImage does not work any more and no Image are shown.

but when press ENTER to use Windows Viewer all seems to work right
so i have to look why FreeImage fail when call from App.

i also try to convert UFT8 -> ANSI

Code: Select all

   cFile := HMG_UNICODE_TO_ANSI(cFile)
   IF !FILE(cFile)
but Result is not correct :(

---

i "think" i made the Error when got Attachment from Outlook and "save" it to Disk
when look in CMD Window it have a Square where HMG show "?" so Filename is wrong.

when rename File in Explorer (F2) i can load File with FreeImage so Image self is OK
i have to fix it in my App where i get Outlook Attachment.

THX for help

Re: File with German Umlaute -> Directory() ?

Posted: Wed Oct 07, 2020 7:01 am
by AUGE_OHR
hi,

i have a Side Effect with my Combobox when use

Code: Select all

SET( _SET_CODEPAGE, "UTF8" )
or not set Codepage ( Default UTF8 in Unicode Version)

Combobox use Drive Letter and that seems to fail while Combobox is empty :shock:

when go back and use

Code: Select all

SET CODEPAGE TO GERMAN
all work again ... so what can be the Problem :idea:

Re: File with German Umlaute -> Directory() ?

Posted: Wed Oct 07, 2020 5:09 pm
by AUGE_OHR
hi

OK got it.
i have a lot of HMG_Calldll() with "A" Function :roll:

when using UTF8 i need "W" Function ... so some Work wait for me

Re: File with German Umlaute -> Directory() ?

Posted: Wed Oct 07, 2020 5:19 pm
by Carlos Britos
Hi, you dont need to put A or W. these are settled in the headers files, so you can call one function without adding the suffix A/W

AUGE_OHR wrote: Wed Oct 07, 2020 5:09 pm hi

OK got it.
i have a lot of HMG_Calldll() with "A" Function :roll:

when using UTF8 i need "W" Function ... so some Work wait for me