瀏覽代碼

* set destination codepage in widestringmanager.Unicode2AnsiMoveProc() like
on other platforms, rather than explicitly setting it afterwards
everywhere

git-svn-id: branches/jvmbackend@20902 -

Jonas Maebe 13 年之前
父節點
當前提交
1efee1d2eb
共有 2 個文件被更改,包括 1 次插入3 次删除
  1. 0 1
      rtl/java/jastrings.inc
  2. 1 2
      rtl/java/justrings.inc

+ 0 - 1
rtl/java/jastrings.inc

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

+ 1 - 2
rtl/java/justrings.inc

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