* set destination codepage in widestringmanager.Unicode2AnsiMoveProc() like

on other platforms, rather than explicitly setting it afterwards
    everywhere

git-svn-id: branches/jvmbackend@20902 -
This commit is contained in:
Jonas Maebe 2012-04-16 20:51:46 +00:00
parent 02413c8a57
commit 1efee1d2eb
2 changed files with 1 additions and 3 deletions

View File

@ -266,7 +266,6 @@ var
begin
U:=UnicodeString(S1)+UnicodeString(S2);
widestringmanager.Unicode2AnsiMoveProc(PUnicodeChar(JLString(U).toCharArray),DestS,cp,Length(U));
AnsistringClass(DestS).fCodePage:=cp;
end;
{$endif FPC_HAS_ANSISTR_CONCAT_COMPLEX}

View File

@ -36,6 +36,7 @@ begin
byte written" -> we already have a terminating zero }
outbuf.get(TJByteArray(AnsiStringClass(dest).fdata),0,outbuf.limit);
{ already null-terminated because of setlength }
SetCodePage(dest,cp,false);
end;
@ -321,7 +322,6 @@ begin
if (cp=CP_ACP) then
cp:=DefaultSystemCodePage;
widestringmanager.Unicode2AnsiMoveProc(punicodechar(@arr), RawByteString(fpc_UChar_To_AnsiStr), cp, 1);
AnsistringClass(fpc_UChar_To_AnsiStr).fCodePage:=cp;
end;
@ -357,7 +357,6 @@ begin
cp:=DefaultSystemCodePage;
arr[0]:=c;
widestringmanager.Unicode2AnsiMoveProc(punicodechar(@arr[0]), fpc_UChar_To_AnsiStr, cp, 1);
AnsistringClass(fpc_UChar_To_AnsiStr).fCodePage:=cp;
end;
{$endif FPC_HAS_UCHAR_TO_ANSISTR}