PDA

View Full Version : Unicode issues



Jimmy Hansen
24-Apr-2023, 07:13 AM
Hi all

We are having huge problems migrating our application to DF20, so any help is welcome!


1. Readln/Read_Block/WriteLn/Write works differently. It seems, now we have to make a OemToUtf8 convertion when reading an ANSI/OEM file, and I guess the other way around when writing. Any way to avoid this?

2. ToOem/Utf8ToOem doesn't work as expected. In DF19, the danish character "" gets translated to "_". In DF20, neither ToOem or Utf8ToOem gives me this result. (ToAnsi have the same issue). Beside this error, it also looks like we have to change a lot of the ToOem/ToAnsi convertions we are doing today.



Are we supposed to make corrections to our code every place we use Read/Write and every place we use toAnsi/ToOem? Thats a big task in a large application!

Thanks in advance

Samuel Pizarro
24-Apr-2023, 08:29 AM
Are we supposed to make corrections to our code every place we use Read/Write and every place we use toAnsi/ToOem?

yes you are!

In fact, the compiler raises the waring for you, exactly for that.. when you use any of those functions.. toAnsi/ToOem , exaclty to make you review them!

Please read these 2 chapters..
DataFlex 2023 Help - Unicode 101 (dataaccess.com) (https://docs.dataaccess.com/dataflexhelp/#t=mergedProjects%2FWelcome%2FUnicode_101.htm)

DataFlex 2023 Help - Unicode in Dataflex (dataaccess.com) (https://docs.dataaccess.com/dataflexhelp/#t=mergedProjects%2FWelcome%2FUnicode_in_DataFlex. htm)


There is no right answer .. The answer is.. it depends on each case.
If after reading these 2 chapters you still have questions, come back with them ..

felipesilva
1-Nov-2023, 06:30 AM
Hi Jimmy,

We had this problem and did the following steps:


1 - We created a routine to convert all external files that are read by our application to UTF-8 (Unicode). This routine evaluates files and when it finds "special characters" it stores the file name in a list of files that need to be "evaluated" by us. This was necessary because special characters are not converted as expected.


2 - We removed all ToOem/ToAnsi treatments from our project.

Felipe Silva