mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-09-04 18:50:37 +02:00
* turn off MB_PRECOMPOSED for encodings named in MSDN multibytetowidechar function, as detailed by Aserge in https://forum.lazarus.freepascal.org/index.php?topic=45380.0;topicseen
git-svn-id: trunk@42043 -
This commit is contained in:
parent
60efc9e81c
commit
f5e684067d
@ -591,10 +591,13 @@ procedure Win32Ansi2UnicodeMove(source:pchar;cp : TSystemCodePage;var dest:Unico
|
|||||||
begin
|
begin
|
||||||
// retrieve length including trailing #0
|
// retrieve length including trailing #0
|
||||||
// not anymore, because this must also be usable for single characters
|
// not anymore, because this must also be usable for single characters
|
||||||
if cp=CP_UTF8 then
|
case cp of
|
||||||
|
// Under https://docs.microsoft.com/en-us/windows/desktop/api/stringapiset/nf-stringapiset-multibytetowidechar
|
||||||
|
CP_UTF8, CP_UTF7, 50220, 50221, 50222, 50225, 50227, 50229, 57002..57011, 42:
|
||||||
dwFlags:=0
|
dwFlags:=0
|
||||||
else
|
else
|
||||||
dwFlags:=MB_PRECOMPOSED;
|
dwFlags:=MB_PRECOMPOSED;
|
||||||
|
end;
|
||||||
destlen:=MultiByteToWideChar(cp, dwFlags, source, len, nil, 0);
|
destlen:=MultiByteToWideChar(cp, dwFlags, source, len, nil, 0);
|
||||||
// this will null-terminate
|
// this will null-terminate
|
||||||
setlength(dest, destlen);
|
setlength(dest, destlen);
|
||||||
|
Loading…
Reference in New Issue
Block a user