Page 1 of 1

Pb migration program with SQLite ANSI db from D2007 to XE4

Posted: 13.12.2017, 10:31
by lfcap
Hello,
I need to migrate ANSI application Delphi 2007 to Unicode XE4.
The program store ANSI data into SQLite 3 file.
The recompiled program with XE4 show incorrectly the read strings from db. The French accents are replaced by "?".

Example with text "Préférence" (é = $E9)
The XE4 program show "Pr?f?rence"

And if the XE4 program write the text into db then it’s stored with UTF8 encode (é = $C3A9).
My additional constraint is possibility to old (D2007) and new (XE4) program to accede (read and write) to the same ANSI database.

It’s possible or not?
How to do?

Thank you for help.

Re: Pb migration program with SQLite ANSI db from D2007 to XE4

Posted: 14.12.2017, 12:28
by marsupilami
Hello lfcap,

which version of Zeos do you use for your Delphi 2007 and for your Delphi XE4? Are both versions on Zeos 7.0? The problem here is that usually no other data than Unicode characters should have been written to your database - this is an SQLite requirement, as far as I know. See "Support for UTF-8 and UTF-16" here: http://www.sqlite.org/version3.html

So I think the database file needs to get corrected to have Strings stored as Unicode - even with the ANSI-Delphi. Newer Zeos versions (7.2 from SVN) should automatically use UTF-8 when talking to your SQLIte 3 database. On Unicode Delphi you get to choose which dialect of Unicode is used but that is mainly for efficiency because in the end it always is Unicode.

With best regards,

Jan