You are not logged in.
Pages: 1
This code doesn't work as i expected...(Same code using string type works)
var
s : RawUTF8;
begin
s := 'ángel garcía';
Writeln(BoolToStr(Pos('á',s) > 0,True)); //shows False
s := 'ángel gómez';
Writeln(Uppercase(s)); //shows áNGEL GARCíA
writeln(IntToStr(Length(s))); //shows 14 (length in bytes, not in chars as string.length)
end.
Offline
You are mixing encoding in your source code.
There are some compiler hints shown. You need to fix it.
UpperCase(s) in SynCommons works only with A-Z characters, as documented.
Length(s) is the length in bytes, by definition.
RawUTF8 is an AnsiString, with code page 65521, i.e. UTF-8.
Please refine your knowledge about encodings, Unicode, UTF-8 and UTF-16, string, UnicodeString and AnsiString with Delphi.
All is as expected.
Online
Pages: 1