* Fixed bug #10716.

git-svn-id: trunk@10139 -
This commit is contained in:
yury 2008-02-01 19:59:12 +00:00
parent 10ac8a3977
commit 0109c29e3f
2 changed files with 2 additions and 3 deletions

View File

@ -313,7 +313,6 @@ const
MB_USEGLYPHCHARS = 4;
CP_ACP = 0;
CP_OEMCP = 1;
WC_NO_BEST_FIT_CHARS = $400;
function MultiByteToWideChar(CodePage:UINT; dwFlags:DWORD; lpMultiByteStr:PChar; cchMultiByte:longint; lpWideCharStr:PWideChar;cchWideChar:longint):longint;
cdecl; external 'coredll' name 'MultiByteToWideChar';
@ -340,7 +339,7 @@ end;
function WideToAnsiBuf(WideBuf: PWideChar; WideCharsLen: longint; AnsiBuf: PChar; AnsiBufLen: longint): longint;
begin
Result := WideCharToMultiByte(CP_ACP, WC_NO_BEST_FIT_CHARS, WideBuf, WideCharsLen, AnsiBuf, AnsiBufLen, nil, nil);
Result := WideCharToMultiByte(CP_ACP, 0, WideBuf, WideCharsLen, AnsiBuf, AnsiBufLen, nil, nil);
if ((WideCharsLen <> -1) or (Result = 0)) and (AnsiBuf <> nil) then
begin
if Result + 1 > AnsiBufLen then

View File

@ -509,7 +509,7 @@ var
begin
if GetLocaleInfo(LID, LT, Buf, 2) > 0 then
begin
WideToAnsiBuf(Buf, -1, Buf2, SizeOf(Buf2));
WideToAnsiBuf(Buf, 1, Buf2, SizeOf(Buf2));
Result := Buf2[0];
end
else