Browse Source

* 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 years ago
parent
commit
9b9252e507
1 changed files with 2 additions and 7 deletions
  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);