Browse Source

merge r 14122 from cpstrnew branch by paul:
fix StringCodePage for empty unicode and ansi strings

git-svn-id: trunk@19088 -

paul 14 years ago
parent
commit
5e9ee14ee7
2 changed files with 2 additions and 2 deletions
  1. 1 1
      rtl/inc/astrings.inc
  2. 1 1
      rtl/inc/ustrings.inc

+ 1 - 1
rtl/inc/astrings.inc

@@ -1123,7 +1123,7 @@ function StringCodePage(const S: RawByteString): TSystemCodePage; overload;
     if assigned(Pointer(S)) then
     if assigned(Pointer(S)) then
       Result:=PAnsiRec(pointer(S)-AnsiFirstOff)^.CodePage
       Result:=PAnsiRec(pointer(S)-AnsiFirstOff)^.CodePage
     else
     else
-      Result:=SizeOf(AnsiChar);
+      Result:=DefaultSystemCodePage;
   end;
   end;
 
 
 
 

+ 1 - 1
rtl/inc/ustrings.inc

@@ -2573,7 +2573,7 @@ function StringCodePage(const S: UnicodeString): TSystemCodePage; overload;
     if assigned(Pointer(S)) then
     if assigned(Pointer(S)) then
       Result:=PUnicodeRec(pointer(S)-UnicodeFirstOff)^.CodePage
       Result:=PUnicodeRec(pointer(S)-UnicodeFirstOff)^.CodePage
     else
     else
-      Result:=SizeOf(UnicodeChar);
+      Result:=DefaultUnicodeCodePage;
   end;
   end;