- Removed Win32Wide2AnsiMove, using Win32Unicode2AnsiMove for both Unicode-to-ansi and Wide-to-ansi conversions. In general, we don't need two different conversion routines in wideStringManager, as long as they differ only in PWideChar vs PUnicodeChar (these types are identical).

git-svn-id: trunk@17202 -
This commit is contained in:
sergei 2011-03-29 05:25:05 +00:00
parent 5c2050e756
commit 3a7ac49cc2
3 changed files with 4 additions and 25 deletions

View File

@ -290,8 +290,11 @@ procedure InitWin32Widestrings;
end;
{$endif}
{ Note: since WideChar=UnicodeChar and PWideChar=PUnicodeChar,
Wide2AnsiMoveProc is identical to Unicode2AnsiStrMoveProc. }
{ Widestring }
widestringmanager.Wide2AnsiMoveProc:=@Win32Wide2AnsiMove;
widestringmanager.Wide2AnsiMoveProc:=@Win32Unicode2AnsiMove;
widestringmanager.Ansi2WideMoveProc:=@Win32Ansi2WideMove;
widestringmanager.UpperWideStringProc:=@Win32WideUpper;
widestringmanager.LowerWideStringProc:=@Win32WideLower;

View File

@ -846,18 +846,6 @@ function CharLowerBuff(lpsz:LPWSTR; cchLength:DWORD):DWORD;
Widestring
******************************************************************************}
procedure Win32Wide2AnsiMove(source:pwidechar;var dest:ansistring;len:SizeInt);
var
destlen: SizeInt;
begin
// retrieve length including trailing #0
// not anymore, because this must also be usable for single characters
destlen:=WideCharToMultiByte(CP_ACP, WC_NO_BEST_FIT_CHARS, source, len, nil, 0, nil, nil);
// this will null-terminate
setlength(dest, destlen);
WideCharToMultiByte(CP_ACP, WC_NO_BEST_FIT_CHARS, source, len, @dest[1], destlen, nil, nil);
end;
procedure Win32Ansi2WideMove(source:pchar;var dest:widestring;len:SizeInt);
var
destlen: SizeInt;

View File

@ -903,18 +903,6 @@ function CharLowerBuff(lpsz:LPWSTR; cchLength:DWORD):DWORD;
stdcall; external 'user32' name 'CharLowerBuffW';
procedure Win32Wide2AnsiMove(source:pwidechar;var dest:ansistring;len:SizeInt);
var
destlen: SizeInt;
begin
// retrieve length including trailing #0
// not anymore, because this must also be usable for single characters
destlen:=WideCharToMultiByte(CP_ACP, WC_NO_BEST_FIT_CHARS, source, len, nil, 0, nil, nil);
// this will null-terminate
setlength(dest, destlen);
WideCharToMultiByte(CP_ACP, WC_NO_BEST_FIT_CHARS, source, len, @dest[1], destlen, nil, nil);
end;
procedure Win32Ansi2WideMove(source:pchar;var dest:widestring;len:SizeInt);
var
destlen: SizeInt;