Forráskód Böngészése

merge r14136 from cpstrnew branch by paul:
- fix return type of StringCodePage functions from Word to TSystemCodePage
- add SetMultiByteConversionCodePage procedure (which just change the DefaultSystemCodePage constant)

git-svn-id: trunk@19095 -

paul 14 éve
szülő
commit
ad8195e9ae
3 módosított fájl, 8 hozzáadás és 2 törlés
  1. 5 0
      rtl/inc/astrings.inc
  2. 2 1
      rtl/inc/systemh.inc
  3. 1 1
      rtl/inc/ustringh.inc

+ 5 - 0
rtl/inc/astrings.inc

@@ -1180,3 +1180,8 @@ procedure SetCodePage(var s : RawByteString; CodePage : TSystemCodePage; Convert
         PAnsiRec(pointer(s)-AnsiFirstOff)^.CodePage:=CodePage;
       end;
   end;
+
+procedure SetMultiByteConversionCodePage(CodePage: TSystemCodePage);
+  begin
+    DefaultSystemCodePage:=CodePage;
+  end;

+ 2 - 1
rtl/inc/systemh.inc

@@ -881,9 +881,10 @@ Function  StringOfChar(c : char;l : SizeInt) : AnsiString;
 function  upcase(const s : ansistring) : ansistring;
 function  lowercase(const s : ansistring) : ansistring;
 
-function StringCodePage(const S : RawByteString): Word; overload;
+function StringCodePage(const S : RawByteString): TSystemCodePage; overload;
 function StringElementSize(const S : RawByteString): Word; overload;
 function StringRefCount(const S : RawByteString): SizeInt; overload;
+procedure SetMultiByteConversionCodePage(CodePage: TSystemCodePage);
 {$endif FPC_HAS_FEATURE_ANSISTRINGS}
 
 

+ 1 - 1
rtl/inc/ustringh.inc

@@ -130,4 +130,4 @@ Procedure SetUnicodeStringManager (Const New : TUnicodeStringManager; Var Old: T
 
 function StringElementSize(const S : UnicodeString): Word; overload;
 function StringRefCount(const S : UnicodeString): SizeInt; overload;
-function StringCodePage(const S : UnicodeString): Word; overload;
+function StringCodePage(const S : UnicodeString): TSystemCodePage; overload;