|
@@ -941,13 +941,13 @@ procedure UnicodeCharLenToStrVar(Src : PUnicodeChar;Len : SizeInt;out Dest : Uni
|
|
|
|
|
|
procedure UnicodeCharLenToStrVar(Src : PUnicodeChar;Len : SizeInt;out Dest : AnsiString);
|
|
procedure UnicodeCharLenToStrVar(Src : PUnicodeChar;Len : SizeInt;out Dest : AnsiString);
|
|
begin
|
|
begin
|
|
- Dest:=UnicodeCharLenToString(Src,Len);
|
|
|
|
|
|
+ Dest:=AnsiString(UnicodeCharLenToString(Src,Len));
|
|
end;
|
|
end;
|
|
|
|
|
|
|
|
|
|
procedure UnicodeCharToStrVar(S : PUnicodeChar;out Dest : AnsiString);
|
|
procedure UnicodeCharToStrVar(S : PUnicodeChar;out Dest : AnsiString);
|
|
begin
|
|
begin
|
|
- Dest:=UnicodeCharToString(S);
|
|
|
|
|
|
+ Dest:=AnsiString(UnicodeCharToString(S));
|
|
end;
|
|
end;
|
|
|
|
|
|
|
|
|
|
@@ -966,7 +966,7 @@ procedure WideCharLenToStrVar(Src : PWideChar;Len : SizeInt;out Dest : UnicodeSt
|
|
|
|
|
|
procedure WideCharLenToStrVar(Src : PWideChar;Len : SizeInt;out Dest : AnsiString);
|
|
procedure WideCharLenToStrVar(Src : PWideChar;Len : SizeInt;out Dest : AnsiString);
|
|
begin
|
|
begin
|
|
- Dest:=WideCharLenToString(Src,Len);
|
|
|
|
|
|
+ Dest:=AnsiString(WideCharLenToString(Src,Len));
|
|
end;
|
|
end;
|
|
|
|
|
|
|
|
|
|
@@ -978,7 +978,7 @@ procedure WideCharToStrVar(S : PWideChar;out Dest : UnicodeString);
|
|
|
|
|
|
procedure WideCharToStrVar(S : PWideChar;out Dest : AnsiString);
|
|
procedure WideCharToStrVar(S : PWideChar;out Dest : AnsiString);
|
|
begin
|
|
begin
|
|
- Dest:=WideCharToString(S);
|
|
|
|
|
|
+ Dest:=AnsiString(WideCharToString(S));
|
|
end;
|
|
end;
|
|
|
|
|
|
|
|
|
|
@@ -1201,45 +1201,44 @@ end;
|
|
{$ifndef FPUNONE}
|
|
{$ifndef FPUNONE}
|
|
Function fpc_Val_Real_UnicodeStr(Const S : UnicodeString; out Code : ValSInt): ValReal; [public, alias:'FPC_VAL_REAL_UNICODESTR']; compilerproc;
|
|
Function fpc_Val_Real_UnicodeStr(Const S : UnicodeString; out Code : ValSInt): ValReal; [public, alias:'FPC_VAL_REAL_UNICODESTR']; compilerproc;
|
|
Var
|
|
Var
|
|
- SS : String;
|
|
|
|
|
|
+ SS: ShortString;
|
|
begin
|
|
begin
|
|
- fpc_Val_Real_UnicodeStr := 0;
|
|
|
|
- if length(S) > 255 then
|
|
|
|
- code := 256
|
|
|
|
|
|
+ fpc_Val_Real_UnicodeStr:=0;
|
|
|
|
+ if length(S)>255 then
|
|
|
|
+ code:=256
|
|
else
|
|
else
|
|
begin
|
|
begin
|
|
- SS := S;
|
|
|
|
|
|
+ SS:=ShortString(S);
|
|
Val(SS,fpc_Val_Real_UnicodeStr,code);
|
|
Val(SS,fpc_Val_Real_UnicodeStr,code);
|
|
end;
|
|
end;
|
|
end;
|
|
end;
|
|
{$endif}
|
|
{$endif}
|
|
|
|
|
|
function fpc_val_enum_unicodestr(str2ordindex:pointer;const s:unicodestring;out code:valsint):longint;compilerproc;
|
|
function fpc_val_enum_unicodestr(str2ordindex:pointer;const s:unicodestring;out code:valsint):longint;compilerproc;
|
|
-
|
|
|
|
-var ss:shortstring;
|
|
|
|
-
|
|
|
|
|
|
+var
|
|
|
|
+ ss: ShortString;
|
|
begin
|
|
begin
|
|
if length(s)>255 then
|
|
if length(s)>255 then
|
|
code:=256
|
|
code:=256
|
|
else
|
|
else
|
|
begin
|
|
begin
|
|
- ss:=s;
|
|
|
|
|
|
+ ss:=ShortString(s);
|
|
val(ss,fpc_val_enum_unicodestr,code);
|
|
val(ss,fpc_val_enum_unicodestr,code);
|
|
end;
|
|
end;
|
|
end;
|
|
end;
|
|
|
|
|
|
Function fpc_Val_Currency_UnicodeStr(Const S : UnicodeString; out Code : ValSInt): Currency; [public, alias:'FPC_VAL_CURRENCY_UNICODESTR']; compilerproc;
|
|
Function fpc_Val_Currency_UnicodeStr(Const S : UnicodeString; out Code : ValSInt): Currency; [public, alias:'FPC_VAL_CURRENCY_UNICODESTR']; compilerproc;
|
|
Var
|
|
Var
|
|
- SS : String;
|
|
|
|
|
|
+ SS: ShortString;
|
|
begin
|
|
begin
|
|
- if length(S) > 255 then
|
|
|
|
|
|
+ if length(S)>255 then
|
|
begin
|
|
begin
|
|
fpc_Val_Currency_UnicodeStr:=0;
|
|
fpc_Val_Currency_UnicodeStr:=0;
|
|
- code := 256;
|
|
|
|
|
|
+ code:=256;
|
|
end
|
|
end
|
|
else
|
|
else
|
|
begin
|
|
begin
|
|
- SS := S;
|
|
|
|
|
|
+ SS:=ShortString(S);
|
|
Val(SS,fpc_Val_Currency_UnicodeStr,code);
|
|
Val(SS,fpc_Val_Currency_UnicodeStr,code);
|
|
end;
|
|
end;
|
|
end;
|
|
end;
|
|
@@ -1247,14 +1246,14 @@ end;
|
|
|
|
|
|
Function fpc_Val_UInt_UnicodeStr (Const S : UnicodeString; out Code : ValSInt): ValUInt; [public, alias:'FPC_VAL_UINT_UNICODESTR']; compilerproc;
|
|
Function fpc_Val_UInt_UnicodeStr (Const S : UnicodeString; out Code : ValSInt): ValUInt; [public, alias:'FPC_VAL_UINT_UNICODESTR']; compilerproc;
|
|
Var
|
|
Var
|
|
- SS : ShortString;
|
|
|
|
|
|
+ SS: ShortString;
|
|
begin
|
|
begin
|
|
- fpc_Val_UInt_UnicodeStr := 0;
|
|
|
|
- if length(S) > 255 then
|
|
|
|
- code := 256
|
|
|
|
|
|
+ fpc_Val_UInt_UnicodeStr:=0;
|
|
|
|
+ if length(S)>255 then
|
|
|
|
+ code:=256
|
|
else
|
|
else
|
|
begin
|
|
begin
|
|
- SS := S;
|
|
|
|
|
|
+ SS:=ShortString(S);
|
|
Val(SS,fpc_Val_UInt_UnicodeStr,code);
|
|
Val(SS,fpc_Val_UInt_UnicodeStr,code);
|
|
end;
|
|
end;
|
|
end;
|
|
end;
|
|
@@ -1262,14 +1261,14 @@ end;
|
|
|
|
|
|
Function fpc_Val_SInt_UnicodeStr (DestSize: SizeInt; Const S : UnicodeString; out Code : ValSInt): ValSInt; [public, alias:'FPC_VAL_SINT_UNICODESTR']; compilerproc;
|
|
Function fpc_Val_SInt_UnicodeStr (DestSize: SizeInt; Const S : UnicodeString; out Code : ValSInt): ValSInt; [public, alias:'FPC_VAL_SINT_UNICODESTR']; compilerproc;
|
|
Var
|
|
Var
|
|
- SS : ShortString;
|
|
|
|
|
|
+ SS: ShortString;
|
|
begin
|
|
begin
|
|
fpc_Val_SInt_UnicodeStr:=0;
|
|
fpc_Val_SInt_UnicodeStr:=0;
|
|
if length(S)>255 then
|
|
if length(S)>255 then
|
|
code:=256
|
|
code:=256
|
|
else
|
|
else
|
|
begin
|
|
begin
|
|
- SS := S;
|
|
|
|
|
|
+ SS:=ShortString(S);
|
|
fpc_Val_SInt_UnicodeStr := int_Val_SInt_ShortStr(DestSize,SS,Code);
|
|
fpc_Val_SInt_UnicodeStr := int_Val_SInt_ShortStr(DestSize,SS,Code);
|
|
end;
|
|
end;
|
|
end;
|
|
end;
|
|
@@ -1279,14 +1278,14 @@ end;
|
|
|
|
|
|
Function fpc_Val_qword_UnicodeStr (Const S : UnicodeString; out Code : ValSInt): qword; [public, alias:'FPC_VAL_QWORD_UNICODESTR']; compilerproc;
|
|
Function fpc_Val_qword_UnicodeStr (Const S : UnicodeString; out Code : ValSInt): qword; [public, alias:'FPC_VAL_QWORD_UNICODESTR']; compilerproc;
|
|
Var
|
|
Var
|
|
- SS : ShortString;
|
|
|
|
|
|
+ SS: ShortString;
|
|
begin
|
|
begin
|
|
fpc_Val_qword_UnicodeStr:=0;
|
|
fpc_Val_qword_UnicodeStr:=0;
|
|
if length(S)>255 then
|
|
if length(S)>255 then
|
|
code:=256
|
|
code:=256
|
|
else
|
|
else
|
|
begin
|
|
begin
|
|
- SS := S;
|
|
|
|
|
|
+ SS:=ShortString(S);
|
|
Val(SS,fpc_Val_qword_UnicodeStr,Code);
|
|
Val(SS,fpc_Val_qword_UnicodeStr,Code);
|
|
end;
|
|
end;
|
|
end;
|
|
end;
|
|
@@ -1294,14 +1293,14 @@ end;
|
|
|
|
|
|
Function fpc_Val_int64_UnicodeStr (Const S : UnicodeString; out Code : ValSInt): Int64; [public, alias:'FPC_VAL_INT64_UNICODESTR']; compilerproc;
|
|
Function fpc_Val_int64_UnicodeStr (Const S : UnicodeString; out Code : ValSInt): Int64; [public, alias:'FPC_VAL_INT64_UNICODESTR']; compilerproc;
|
|
Var
|
|
Var
|
|
- SS : ShortString;
|
|
|
|
|
|
+ SS: ShortString;
|
|
begin
|
|
begin
|
|
fpc_Val_int64_UnicodeStr:=0;
|
|
fpc_Val_int64_UnicodeStr:=0;
|
|
if length(S)>255 then
|
|
if length(S)>255 then
|
|
code:=256
|
|
code:=256
|
|
else
|
|
else
|
|
begin
|
|
begin
|
|
- SS := S;
|
|
|
|
|
|
+ SS:=ShortString(S);
|
|
Val(SS,fpc_Val_int64_UnicodeStr,Code);
|
|
Val(SS,fpc_Val_int64_UnicodeStr,Code);
|
|
end;
|
|
end;
|
|
end;
|
|
end;
|
|
@@ -1312,56 +1311,54 @@ end;
|
|
{$ifndef FPUNONE}
|
|
{$ifndef FPUNONE}
|
|
procedure fpc_UnicodeStr_Float(d : ValReal;len,fr,rt : SizeInt;out s : UnicodeString);compilerproc;
|
|
procedure fpc_UnicodeStr_Float(d : ValReal;len,fr,rt : SizeInt;out s : UnicodeString);compilerproc;
|
|
var
|
|
var
|
|
- ss : shortstring;
|
|
|
|
|
|
+ ss: shortstring;
|
|
begin
|
|
begin
|
|
str_real(len,fr,d,treal_type(rt),ss);
|
|
str_real(len,fr,d,treal_type(rt),ss);
|
|
- s:=ss;
|
|
|
|
|
|
+ s:=UnicodeString(ss);
|
|
end;
|
|
end;
|
|
{$endif}
|
|
{$endif}
|
|
|
|
|
|
procedure fpc_unicodestr_enum(ordinal,len:sizeint;typinfo,ord2strindex:pointer;out s:unicodestring);compilerproc;
|
|
procedure fpc_unicodestr_enum(ordinal,len:sizeint;typinfo,ord2strindex:pointer;out s:unicodestring);compilerproc;
|
|
-
|
|
|
|
-var ss:shortstring;
|
|
|
|
-
|
|
|
|
|
|
+var
|
|
|
|
+ ss: ShortString;
|
|
begin
|
|
begin
|
|
fpc_shortstr_enum(ordinal,len,typinfo,ord2strindex,ss);
|
|
fpc_shortstr_enum(ordinal,len,typinfo,ord2strindex,ss);
|
|
- s:=ss;
|
|
|
|
|
|
+ s:=UnicodeString(ss);
|
|
end;
|
|
end;
|
|
|
|
|
|
procedure fpc_unicodestr_bool(b : boolean;len:sizeint;out s:unicodestring);compilerproc;
|
|
procedure fpc_unicodestr_bool(b : boolean;len:sizeint;out s:unicodestring);compilerproc;
|
|
-
|
|
|
|
-var ss:shortstring;
|
|
|
|
-
|
|
|
|
|
|
+var
|
|
|
|
+ ss: ShortString;
|
|
begin
|
|
begin
|
|
fpc_shortstr_bool(b,len,ss);
|
|
fpc_shortstr_bool(b,len,ss);
|
|
- s:=ss;
|
|
|
|
|
|
+ s:=UnicodeString(ss);
|
|
end;
|
|
end;
|
|
|
|
|
|
{$ifdef FPC_HAS_STR_CURRENCY}
|
|
{$ifdef FPC_HAS_STR_CURRENCY}
|
|
procedure fpc_UnicodeStr_Currency(c : Currency;len,fr : SizeInt;out s : UnicodeString);compilerproc;
|
|
procedure fpc_UnicodeStr_Currency(c : Currency;len,fr : SizeInt;out s : UnicodeString);compilerproc;
|
|
var
|
|
var
|
|
- ss : shortstring;
|
|
|
|
|
|
+ ss: shortstring;
|
|
begin
|
|
begin
|
|
str(c:len:fr,ss);
|
|
str(c:len:fr,ss);
|
|
- s:=ss;
|
|
|
|
|
|
+ s:=UnicodeString(ss);
|
|
end;
|
|
end;
|
|
{$endif FPC_HAS_STR_CURRENCY}
|
|
{$endif FPC_HAS_STR_CURRENCY}
|
|
|
|
|
|
Procedure fpc_UnicodeStr_SInt(v : ValSint; Len : SizeInt; out S : UnicodeString);compilerproc;
|
|
Procedure fpc_UnicodeStr_SInt(v : ValSint; Len : SizeInt; out S : UnicodeString);compilerproc;
|
|
Var
|
|
Var
|
|
- SS : ShortString;
|
|
|
|
|
|
+ SS: ShortString;
|
|
begin
|
|
begin
|
|
Str (v:Len,SS);
|
|
Str (v:Len,SS);
|
|
- S:=SS;
|
|
|
|
|
|
+ S:=UnicodeString(SS);
|
|
end;
|
|
end;
|
|
|
|
|
|
|
|
|
|
Procedure fpc_UnicodeStr_UInt(v : ValUInt;Len : SizeInt; out S : UnicodeString);compilerproc;
|
|
Procedure fpc_UnicodeStr_UInt(v : ValUInt;Len : SizeInt; out S : UnicodeString);compilerproc;
|
|
Var
|
|
Var
|
|
- SS : ShortString;
|
|
|
|
|
|
+ SS: ShortString;
|
|
begin
|
|
begin
|
|
str(v:Len,SS);
|
|
str(v:Len,SS);
|
|
- S:=SS;
|
|
|
|
|
|
+ S:=UnicodeString(SS);
|
|
end;
|
|
end;
|
|
|
|
|
|
|
|
|
|
@@ -1369,19 +1366,19 @@ end;
|
|
|
|
|
|
Procedure fpc_UnicodeStr_Int64(v : Int64; Len : SizeInt; out S : UnicodeString);compilerproc;
|
|
Procedure fpc_UnicodeStr_Int64(v : Int64; Len : SizeInt; out S : UnicodeString);compilerproc;
|
|
Var
|
|
Var
|
|
- SS : ShortString;
|
|
|
|
|
|
+ SS: ShortString;
|
|
begin
|
|
begin
|
|
Str (v:Len,SS);
|
|
Str (v:Len,SS);
|
|
- S:=SS;
|
|
|
|
|
|
+ S:=UnicodeString(SS);
|
|
end;
|
|
end;
|
|
|
|
|
|
|
|
|
|
Procedure fpc_UnicodeStr_Qword(v : Qword;Len : SizeInt; out S : UnicodeString);compilerproc;
|
|
Procedure fpc_UnicodeStr_Qword(v : Qword;Len : SizeInt; out S : UnicodeString);compilerproc;
|
|
Var
|
|
Var
|
|
- SS : ShortString;
|
|
|
|
|
|
+ SS: ShortString;
|
|
begin
|
|
begin
|
|
str(v:Len,SS);
|
|
str(v:Len,SS);
|
|
- S:=SS;
|
|
|
|
|
|
+ S:=UnicodeString(SS);
|
|
end;
|
|
end;
|
|
|
|
|
|
{$endif CPU64}
|
|
{$endif CPU64}
|
|
@@ -1832,7 +1829,7 @@ function AnsiToUtf8(const s : RawByteString): RawByteString;{$ifdef SYSTEMINLINE
|
|
|
|
|
|
function Utf8ToAnsi(const s : RawByteString) : RawByteString;{$ifdef SYSTEMINLINE}inline;{$endif}
|
|
function Utf8ToAnsi(const s : RawByteString) : RawByteString;{$ifdef SYSTEMINLINE}inline;{$endif}
|
|
begin
|
|
begin
|
|
- Result:=Utf8Decode(s);
|
|
|
|
|
|
+ Result:=RawByteString(Utf8Decode(s));
|
|
end;
|
|
end;
|
|
|
|
|
|
|
|
|