瀏覽代碼

* don't depend on the (non-Delphi-compatible) behaviour that the current
code page of a rawbytestring influences the code page of concatenated
strings assigned to it (this behaviour will be fixed/changed in the
next commit)

git-svn-id: branches/cpstrrtl@25142 -

Jonas Maebe 12 年之前
父節點
當前提交
9b9252e507
共有 1 個文件被更改,包括 2 次插入7 次删除
  1. 2 7
      tests/test/units/sysutils/tunifile.pp

+ 2 - 7
tests/test/units/sysutils/tunifile.pp

@@ -30,11 +30,9 @@ var
   f: THandle;
   r: rawbytestring;
 begin
-  { can't set code page of an empty string }
-  r:=' ';
-  setcodepage(r,DefaultFileSystemCodePage,false);
   u:='‹≈©◊';
   r:=u;
+  setcodepage(r,DefaultFileSystemCodePage);
   if r=u then
     begin
       f:=FileCreate(u,fmShareDenyNone,(6 shl 6) or (4 shl 3) or 4);
@@ -66,11 +64,8 @@ var
   f: THandle;
   r: rawbytestring;
 begin
-  { can't set code page of an empty string }
-  r:=' ';
-  setcodepage(r,DefaultFileSystemCodePage,false);
   u:='‹≈©◊';
-  r:=u;
+  widestringmanager.unicode2ansimoveproc(punicodechar(u),r,DefaultFileSystemCodePage,length(u));
   if r=u then
     begin
       f:=FileCreate(u,fmShareDenyNone,(6 shl 6) or (4 shl 3) or 4);