mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-09-10 10:29:17 +02:00
merge r19075 from cpstrnew branch by paul:
rtl: change UTF8Decode, UTF8Encode, AnsiToUTF8, UTF8ToAnsi to use RawByteString as arguments/result for compatibility with the old code and also with delphi git-svn-id: trunk@19128 -
This commit is contained in:
parent
f3ebaab222
commit
631c545423
@ -110,11 +110,11 @@ function UnicodeToUtf8(Dest: PChar; Source: PUnicodeChar; MaxBytes: SizeInt): Si
|
||||
function UnicodeToUtf8(Dest: PChar; MaxDestBytes: SizeUInt; Source: PUnicodeChar; SourceChars: SizeUInt): SizeUInt;
|
||||
function Utf8ToUnicode(Dest: PUnicodeChar; Source: PChar; MaxChars: SizeInt): SizeInt;{$ifdef SYSTEMINLINE}inline;{$endif}
|
||||
function Utf8ToUnicode(Dest: PUnicodeChar; MaxDestChars: SizeUInt; Source: PChar; SourceBytes: SizeUInt): SizeUInt;
|
||||
function UTF8Encode(const s : RawByteString) : UTF8String; inline;
|
||||
function UTF8Encode(const s : UnicodeString) : UTF8String;
|
||||
function UTF8Decode(const s : UTF8String): UnicodeString;
|
||||
function AnsiToUtf8(const s : RawByteString): UTF8String;{$ifdef SYSTEMINLINE}inline;{$endif}
|
||||
function Utf8ToAnsi(const s : UTF8String) : RawByteString;{$ifdef SYSTEMINLINE}inline;{$endif}
|
||||
function UTF8Encode(const s : RawByteString) : RawByteString; inline;
|
||||
function UTF8Encode(const s : UnicodeString) : RawByteString;
|
||||
function UTF8Decode(const s : RawByteString): UnicodeString;
|
||||
function AnsiToUtf8(const s : RawByteString): RawByteString;{$ifdef SYSTEMINLINE}inline;{$endif}
|
||||
function Utf8ToAnsi(const s : RawByteString) : RawByteString;{$ifdef SYSTEMINLINE}inline;{$endif}
|
||||
function UnicodeStringToUCS4String(const s : UnicodeString) : UCS4String;
|
||||
function UCS4StringToUnicodeString(const s : UCS4String) : UnicodeString;
|
||||
function WideStringToUCS4String(const s : WideString) : UCS4String;
|
||||
|
@ -2386,13 +2386,13 @@ function UTF8ToUnicode(Dest: PUnicodeChar; MaxDestChars: SizeUInt; Source: PChar
|
||||
end;
|
||||
|
||||
|
||||
function UTF8Encode(const s : RawByteString) : UTF8String; inline;
|
||||
function UTF8Encode(const s : RawByteString) : RawByteString; inline;
|
||||
begin
|
||||
Result:=UTF8Encode(UnicodeString(s));
|
||||
end;
|
||||
|
||||
|
||||
function UTF8Encode(const s : UnicodeString) : UTF8String;
|
||||
function UTF8Encode(const s : UnicodeString) : RawByteString;
|
||||
var
|
||||
i : SizeInt;
|
||||
hs : UTF8String;
|
||||
@ -2410,7 +2410,7 @@ function UTF8Encode(const s : UnicodeString) : UTF8String;
|
||||
end;
|
||||
|
||||
|
||||
function UTF8Decode(const s : UTF8String): UnicodeString;
|
||||
function UTF8Decode(const s : RawByteString): UnicodeString;
|
||||
var
|
||||
i : SizeInt;
|
||||
hs : UnicodeString;
|
||||
@ -2428,13 +2428,13 @@ function UTF8Decode(const s : UTF8String): UnicodeString;
|
||||
end;
|
||||
|
||||
|
||||
function AnsiToUtf8(const s : RawByteString): UTF8String;{$ifdef SYSTEMINLINE}inline;{$endif}
|
||||
function AnsiToUtf8(const s : RawByteString): RawByteString;{$ifdef SYSTEMINLINE}inline;{$endif}
|
||||
begin
|
||||
Result:=Utf8Encode(s);
|
||||
end;
|
||||
|
||||
|
||||
function Utf8ToAnsi(const s : UTF8String) : RawByteString;{$ifdef SYSTEMINLINE}inline;{$endif}
|
||||
function Utf8ToAnsi(const s : RawByteString) : RawByteString;{$ifdef SYSTEMINLINE}inline;{$endif}
|
||||
begin
|
||||
Result:=Utf8Decode(s);
|
||||
end;
|
||||
|
@ -41,7 +41,7 @@ function UnicodeToUtf8(Dest: PChar; Source: PWideChar; MaxBytes: SizeInt): SizeI
|
||||
function UnicodeToUtf8(Dest: PChar; MaxDestBytes: SizeUInt; Source: PWideChar; SourceChars: SizeUInt): SizeUInt;
|
||||
function Utf8ToUnicode(Dest: PWideChar; Source: PChar; MaxChars: SizeInt): SizeInt;{$ifdef SYSTEMINLINE}inline;{$endif}
|
||||
function Utf8ToUnicode(Dest: PWideChar; MaxDestChars: SizeUInt; Source: PChar; SourceBytes: SizeUInt): SizeUInt;
|
||||
function UTF8Encode(const s : WideString) : UTF8String;
|
||||
function UTF8Encode(const s : WideString) : RawByteString;
|
||||
|
||||
{$ifdef MSWINDOWS}
|
||||
const
|
||||
|
@ -1656,7 +1656,7 @@ function UTF8ToUnicode(Dest: PWideChar; MaxDestChars: SizeUInt; Source: PChar; S
|
||||
end;
|
||||
|
||||
|
||||
function UTF8Encode(const s : WideString) : UTF8String;
|
||||
function UTF8Encode(const s : WideString) : RawByteString;
|
||||
var
|
||||
i : SizeInt;
|
||||
hs : UTF8String;
|
||||
|
Loading…
Reference in New Issue
Block a user