* the code page of unicodestring/widestring on big endian targets is

UTF-16BE, not UTF-16LE

git-svn-id: trunk@21255 -
This commit is contained in:
Jonas Maebe 2012-05-08 13:38:16 +00:00
parent 67ab61dcc8
commit ab914a8ae3
2 changed files with 14 additions and 4 deletions

View File

@ -104,7 +104,8 @@ interface
{$endif FPC_LITTLE_ENDIAN}
{$endif}
CP_UTF8 = 65001;
CP_UTF16 = 1200;
CP_UTF16LE = 1200;
CP_UTF16BE = 1201;
CP_NONE = 65535;

View File

@ -1686,7 +1686,10 @@ implementation
begin
inherited create(stringdef);
stringtype:=st_widestring;
encoding:=CP_UTF16;
if target_info.endian=endian_little then
encoding:=CP_UTF16LE
else
encoding:=CP_UTF16BE;
len:=-1;
savesize:=sizeof(pint);
end;
@ -1696,7 +1699,10 @@ implementation
begin
inherited ppuload(stringdef,ppufile);
stringtype:=st_widestring;
encoding:=CP_UTF16;
if target_info.endian=endian_little then
encoding:=CP_UTF16LE
else
encoding:=CP_UTF16BE;
len:=ppufile.getaint;
savesize:=sizeof(pint);
end;
@ -1706,7 +1712,10 @@ implementation
begin
inherited create(stringdef);
stringtype:=st_unicodestring;
encoding:=CP_UTF16;
if target_info.endian=endian_little then
encoding:=CP_UTF16LE
else
encoding:=CP_UTF16BE;
len:=-1;
savesize:=sizeof(pint);
end;