Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

UTF8<>UTF16 with supplementary plane

borneq
2014-02-25
2014-03-11
  • borneq
    borneq
    2014-02-25

    Unicode characters with code >=$10000 are not properly converted to UTF8 (anyway old Delphi)
    UTF16 this codes has two surrogates.
    Need do uncomment UnicodeToUtf8..Utf8ToAnsi and add this handling
    I attach SynUnicode.patch.zip

     
    Last edit: borneq 2014-03-11
    Attachments
  • borneq
    borneq
    2014-03-11


    L := Utf8ToUnicode(PWideChar(Temp), Length(Temp)+1, PAnsiChar(S), Length(S));
    if L > 0 then
    SetLength(Temp, L)


    instead SetLength(Temp, L-1)