You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The documentation states that a WideChar(#0) is added at the end (if something is written)
So your destination should be defined as:
var
dest: array[0..10] of WideChar;
For me, it works as expected and defined.
Especially you NEED to follow this requirement: enough place must be available in dest buffer (guess is sourceBytes*3+2)
which was not the case in your code.
Hi @synopse,
I think I found an issue in the new implemenation of Utf8ToWideChar.
I use Delphi 12.1, target Win32
I'm using the JSONToDataSet() function and this function fails with the latest revisions of Mormot2.
After tracing the code I've found an Issue:
Utf8ToWideChar() truncates the destination string.
The resulting string is shortened by 1 character.
How to reproduce
Workaround
Note: It seems that this fixes the problem, but I'm not certain about my correction
In unit mormot.core.unicode.pas
I replace lines 2870 and 2899:
if PtrUInt(@dest[1]) >= PtrUInt(endDest) then
with
if PtrUInt(@dest[1]) > PtrUInt(endDest) then
The text was updated successfully, but these errors were encountered: