File with German Umlaute -> Directory() ?

General Help regarding HMG, Compilation, Linking, Samples

Moderator: Rathinagiri

User avatar
AUGE_OHR
Posts: 1149
Joined: Sun Aug 25, 2019 3:12 pm
DBs Used: DBF, PostgreSQL, MySQL, SQLite
Location: Hamburg, Germany
Has thanked: 213 times
Been thanked: 310 times

File with German Umlaute -> Directory() ?

Post 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 865 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 :?:
have fun
Jimmy

User avatar
AUGE_OHR
Posts: 1149
Joined: Sun Aug 25, 2019 3:12 pm
DBs Used: DBF, PostgreSQL, MySQL, SQLite
Location: Hamburg, Germany
Has thanked: 213 times
Been thanked: 310 times

Post by AUGE_OHR »

hi

here Sample file
how to show it :idea:
Demo_UTF8.ZIP
(127.04 KiB) Downloaded 34 times
have fun
Jimmy

User avatar
AUGE_OHR
Posts: 1149
Joined: Sun Aug 25, 2019 3:12 pm
DBs Used: DBF, PostgreSQL, MySQL, SQLite
Location: Hamburg, Germany
Has thanked: 213 times
Been thanked: 310 times

Post 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 779 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:
have fun
Jimmy

edk
Posts: 617
Joined: Thu Oct 16, 2014 11:35 am
Location: Poland
Has thanked: 150 times
Been thanked: 552 times

Post 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 755 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.
Attachments
directory.7z
(128.61 KiB) Downloaded 37 times

User avatar
AUGE_OHR
Posts: 1149
Joined: Sun Aug 25, 2019 3:12 pm
DBs Used: DBF, PostgreSQL, MySQL, SQLite
Location: Hamburg, Germany
Has thanked: 213 times
Been thanked: 310 times

Post 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
have fun
Jimmy

edk
Posts: 617
Joined: Thu Oct 16, 2014 11:35 am
Location: Poland
Has thanked: 150 times
Been thanked: 552 times

Post 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() )

User avatar
AUGE_OHR
Posts: 1149
Joined: Sun Aug 25, 2019 3:12 pm
DBs Used: DBF, PostgreSQL, MySQL, SQLite
Location: Hamburg, Germany
Has thanked: 213 times
Been thanked: 310 times

Post 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
have fun
Jimmy

User avatar
AUGE_OHR
Posts: 1149
Joined: Sun Aug 25, 2019 3:12 pm
DBs Used: DBF, PostgreSQL, MySQL, SQLite
Location: Hamburg, Germany
Has thanked: 213 times
Been thanked: 310 times

Post 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:
have fun
Jimmy

User avatar
AUGE_OHR
Posts: 1149
Joined: Sun Aug 25, 2019 3:12 pm
DBs Used: DBF, PostgreSQL, MySQL, SQLite
Location: Hamburg, Germany
Has thanked: 213 times
Been thanked: 310 times

Post 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
have fun
Jimmy

Carlos Britos
Posts: 242
Joined: Sat Aug 02, 2008 5:03 pm
Has thanked: 7 times
Been thanked: 13 times

Post 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
Regards/Saludos, Carlos (bcd12a)

Post Reply