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 -
This commit is contained in:
paul 2011-09-17 11:46:33 +00:00
parent b3db8db481
commit ad8195e9ae
3 changed files with 8 additions and 2 deletions

View File

@ -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;

View File

@ -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}

View File

@ -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;