Codepage UTF8 and "read" File from Disk

General Help regarding HMG, Compilation, Linking, Samples

Moderator: Rathinagiri

Post Reply
User avatar
AUGE_OHR
Posts: 2117
Joined: Sun Aug 25, 2019 3:12 pm
DBs Used: DBF, PostgreSQL, MySQL, SQLite
Location: Hamburg, Germany

Codepage UTF8 and "read" File from Disk

Post by AUGE_OHR »

hi,

i have to use

Code: Select all

   USE (cAppdir+cDBF) EXCLUSIVE VIA "DBFCDX" CODEPAGE "UTF8"
to display Filename with "German Umlaute" like City "Köln"

when try to "APPEND" from DBF it does show "Umlaute" wrong :(

---

when Import *.m3u File into DBF i have to use

Code: Select all

   USE (cDBF) EXCLUSIVE ALIAS "IMPORT" VIA "DBFCDX"
without Codepage :!:

but when APPEND DBF i have to use this

Code: Select all

   IF USED()
      CLOSE
      // open without Codepage for APPEND ???  
      USE (cAppdir+cDBF) EXCLUSIVE VIA "DBFCDX"
      APPEND FROM ( cImport )
      CLOSE

      // re-open with Codepage UTF8 
      USE (cAppdir+cDBF) EXCLUSIVE VIA "DBFCDX" CODEPAGE "UTF8"
      GO TOP
      DoMethod( "IPTVMAIN", "Browse_1", "refresh" )
so what do i "miss" :?:
have fun
Jimmy
User avatar
serge_girard
Posts: 3420
Joined: Sun Nov 25, 2012 2:44 pm
DBs Used: 1 MySQL - MariaDB
2 DBF
Location: Belgium
Contact:

Re: Codepage UTF8 and "read" File from Disk

Post by serge_girard »

Jimmy,

How was DBF created?
When I dbcreate in PRG I have no problems with umlauts and french or spanish accents.

Serge
There's nothing you can do that can't be done...
User avatar
Claudio Ricardo
Posts: 367
Joined: Tue Oct 27, 2020 3:38 am
DBs Used: DBF, MySQL, MariaDB
Location: Bs. As. - Argentina

Re: Codepage UTF8 and "read" File from Disk

Post by Claudio Ricardo »

Thanks Serge... at first I put:
If ! File (Xxx.dbf)
DbCreate (Xxx....{.........}) // same with all dbf's
I had problems with the accents in the test tables (created with the IDE utility) but when delivering to the client,
so that it had empty tables, it eliminated them from the folder to be delivered, so that the program, not finding them,
would create them empty, and now there were no problems with accents or the letter Ñ... Now I understand why...
Thank you so much for clearing up the mystery!
Corrige al sabio y lo harás más sabio, Corrige al necio y lo harás tu enemigo.
WhatsApp / Telegram: +54 911-63016162
User avatar
AUGE_OHR
Posts: 2117
Joined: Sun Aug 25, 2019 3:12 pm
DBs Used: DBF, PostgreSQL, MySQL, SQLite
Location: Hamburg, Germany

Re: Codepage UTF8 and "read" File from Disk

Post by AUGE_OHR »

hi Serge,
serge_girard wrote: Wed Jun 01, 2022 10:48 am How was DBF created?
When I dbcreate in PRG I have no problems with umlauts and french or spanish accents.
i always create DBF "in" App ( Unicode Version ) like Claudio

---

1st. i "read" *.M3U File into DBF without any Codepage and they seem display correct in HBFM App

when open "same" DBF in IPTV i have to use Codepage UTF8 ... hm
but when have Create Empty DBF, open with Codepage UTF8, and APPEND FROM "same" DBF it display wrong :o

HBFM and IPTV use same "Config.INI"

Code: Select all

      // setLanguage and Codepage
      hb_LANGSELECT( cLANG )
      hb_CDPSELECT( cLCID )
so the Question is about APPEND FROM as it have no Codepage Option.
have fun
Jimmy
User avatar
gfilatov
Posts: 1116
Joined: Fri Aug 01, 2008 5:42 am
Location: Ukraine
Contact:

Re: Codepage UTF8 and "read" File from Disk

Post by gfilatov »

AUGE_OHR wrote: Thu Jun 02, 2022 3:31 am ...
so the Question is about APPEND FROM as it have no Codepage Option.
Hi Jimmy,

Please take a look for a correct syntax of the APPEND FROM command:
APPEND [FROM <(f)>] [FIELDS <fields,...>] ;
[FOR <for>] [WHILE <while>] [NEXT <next>] ;
[RECORD <rec>] [<rest:REST>] [ALL] [VIA <rdd>] ;
[CODEPAGE <cp>]
Hope that useful :idea:
Kind Regards,
Grigory Filatov

"Everything should be made as simple as possible, but no simpler." Albert Einstein
User avatar
AUGE_OHR
Posts: 2117
Joined: Sun Aug 25, 2019 3:12 pm
DBs Used: DBF, PostgreSQL, MySQL, SQLite
Location: Hamburg, Germany

Re: Codepage UTF8 and "read" File from Disk

Post by AUGE_OHR »

hi Grigory,

seems i have a "old" Help File
https://harbour.github.io/doc/clc53.htm ... d-from-cmd
APPEND FROM <xcFile>
[FIELDS <idField list>]
[<scope>] [WHILE <lCondition>] [FOR <lCondition>]
[SDF | DELIMITED [WITH BLANK | <xcDelimiter>] |
[VIA <xcDriver>]]
where do i find "new" Syntax :?:
Thx, Jimmy
have fun
Jimmy
User avatar
gfilatov
Posts: 1116
Joined: Fri Aug 01, 2008 5:42 am
Location: Ukraine
Contact:

Re: Codepage UTF8 and "read" File from Disk

Post by gfilatov »

AUGE_OHR wrote: Thu Jun 02, 2022 8:25 am hi Grigory,

seems i have a "old" Help File
https://harbour.github.io/doc/clc53.htm ... d-from-cmd

where do i find "new" Syntax :?:
Jimmy,

Please click the Harbour implementation link on the above page for recent Harbour modification.

That's all :arrow:
Kind Regards,
Grigory Filatov

"Everything should be made as simple as possible, but no simpler." Albert Einstein
User avatar
AUGE_OHR
Posts: 2117
Joined: Sun Aug 25, 2019 3:12 pm
DBs Used: DBF, PostgreSQL, MySQL, SQLite
Location: Hamburg, Germany

Re: Codepage UTF8 and "read" File from Disk

Post by AUGE_OHR »

hi Grigory,
gfilatov wrote: Thu Jun 02, 2022 8:53 am Please click the Harbour implementation link on the above page for recent Harbour modification.
Aha :D
have fun
Jimmy
Post Reply