#1 2022-04-01 07:06:38

Leslie7
Member
Registered: 2015-06-25
Posts: 248

Utf8ToString shortens strings with national characters

Hi,

only the part before the national character is in the result.

Utf8ToString('parkolás')  ---> 'parkol'


Versions:
FPC/Lazarus fixes branch -up to date
mORMot 1.18  -up to date

Last edited by Leslie7 (2022-04-01 07:08:07)

Offline

#2 2022-04-01 08:32:39

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

Re: Utf8ToString shortens strings with national characters

Are you sure your source code file is UTF-8 encoded?

Offline

#3 2022-04-01 09:19:51

Leslie7
Member
Registered: 2015-06-25
Posts: 248

Re: Utf8ToString shortens strings with national characters

Yes.

Offline

#4 2022-04-01 15:03:14

Leslie7
Member
Registered: 2015-06-25
Posts: 248

Re: Utf8ToString shortens strings with national characters

The problem was stated in a misleading way. Sorry! It actually works when the parameter is a constant.

In my case the value comes from an XML reader as a UnicodeString which is assigned to a RawUTF8 property. No direct conversion, the compiler is handling it, because anything I have tried made it worse.

When this property is the parameter, that is when the problem occurs.

Last edited by Leslie7 (2022-04-01 15:03:49)

Offline

Board footer

Powered by FluxBB