#1 2020-04-29 14:43:51

edwinsn
Member
Registered: 2010-07-02
Posts: 1,218

What if String properties of TSQLRecord suddenly changed to RawUtf8?

Hello ab,

Lets say I have a TSQLRecord-derived record whose string properties are defined as 'String'.

Now if I changed the source code and all 'String' properties become 'RawUtf8', will error happen when reading back the record data from SQLite db?

Thanks.


Delphi XE4 Pro on Windows 7 64bit.
Lazarus trunk built with fpcupdelux on Windows with cross-compile for Linux 64bit.

Offline

#2 2020-04-29 20:08:36

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,673
Website

Re: What if String properties of TSQLRecord suddenly changed to RawUtf8?

No error: it will be transparent.

The data is stored as UTF-8, so with Delphi XE4 did already make the proper conversion from UTF-16 into UTF-8.
So if you change "UnicodeString" into "RawUTF8" properties, you will have the proper UTF-8 encoded data.

Ensure you don't miss any unexpected string/RawUTF8 conversion in your code by following compiler hints.

Offline

#3 2020-04-30 06:34:17

edwinsn
Member
Registered: 2010-07-02
Posts: 1,218

Re: What if String properties of TSQLRecord suddenly changed to RawUtf8?

@ab,

Thank you! I got it. mORMot is the BEST!


Delphi XE4 Pro on Windows 7 64bit.
Lazarus trunk built with fpcupdelux on Windows with cross-compile for Linux 64bit.

Offline

Board footer

Powered by FluxBB