You are not logged in.
Hello
I have legacy firebird database with code page WIN1250. Still on mORMot 1.18.
What should I do to get whole string ('usługa' instead of 'us') when getting column values via RowDocVariant method. Should I set some additional Zeos connection properties?
I've checked that TSQLDBStatement.FetchAllAsJSON method returns "unmodified" string...
Thanks in advance
Marcin
Last edited by marcinb (2021-04-14 18:39:40)
Offline
I assume there shouldn't be any problem in reading from WIN1250 FB DB. TDocVariant from RowDocVariant should contain a full RawUTF8 string. Could it be that you got the loss afterward? maybe due to direct string assigning
Offline
Hi
I did some digging (debugging) and found guilty routine: it's UTF8ToWideChar from ZEncode unit called by UTF8ToSynUnicode from SynCommons.
I'm on Delphi 10.4, but finally I'd like to compile this project in FPC on linux.
TIA
Marcin
Offline
I'm also using 10.4.2. I specifically made a test with the direct select statement execution and RowDocVariant through Zeos (WIN1250 DB).
In my case UTF8ToSynUnicode from SynCommons calls UTF8ToWideChar from SynCommons. And it seems working ok... - checked the resulting variant value from the debugger.
I used FB 2.5.9, although I doubt that it matters. Btw, I checked both, with USE_SYNCOMMONS and without it. Probably I misunderstand something, sorry.
Offline
Can someone help me here, please
For unknow reason my project uses UTF8ToWideChar from ZEncoding instead of this one from SynCommons. It might be some settings I'm not aware of
TIA
Marcin
Last edited by marcinb (2021-04-15 13:59:29)
Offline
Hello Arnaud
Latest mORMot (downloaded today) and Zeos 7.2.10 with latest patches (of 8th of April)
function UTF8ToWideChar from SynCommons returns 'us' string instead of 'usługa' (note the 3rd character in "usługa")
Any clues?
TIA
Marcin
Offline
Zeos 7.2.10 with latest patches (of 8th of April)
I'm using the trunk Zeos version. You could try it, probably not all fixes go to patches for a stable Zeos.
https://sourceforge.net/p/zeoslib/code- … ree/trunk/ or https://github.com/frones/ZeosLib
Offline
I have checked same with UTF8 database and it is ok.
So following Arnaud's 'guessing' I'll try to set proper charset for db connection and see where I'll end up.
Offline
@marcinb
what's the database characterset? If it's characterset "none"? If so you'll propably need an extra advice.
Michael
Offline
Hello
Actually two things did the trick
- update of mORMot and Zeos
- explicilty specifying required characterset for the connection.
I have to perform more tests, but so far it looks good
Thanks for all suggestions
Marcin
Offline