--- Merging r31480 into '.':

U    rtl/inc/ustrings.inc
A    tests/webtbs/tw28593.pp
--- Recording mergeinfo for merge of r31480 into '.':
 U   .

# revisions: 31480

git-svn-id: branches/fixes_3_0@32261 -
This commit is contained in:
joost 2015-11-06 20:37:21 +00:00
parent f2e27b2585
commit aef7142f34
3 changed files with 29 additions and 1 deletions

1
.gitattributes vendored
View File

@ -14284,6 +14284,7 @@ tests/webtbs/tw2853c.pp svneol=native#text/plain
tests/webtbs/tw2853d.pp svneol=native#text/plain
tests/webtbs/tw2853e.pp svneol=native#text/plain
tests/webtbs/tw2859.pp svneol=native#text/plain
tests/webtbs/tw28593.pp svneol=native#text/plain
tests/webtbs/tw2865.pp svneol=native#text/plain
tests/webtbs/tw28674.pp svneol=native#text/pascal
tests/webtbs/tw28718a.pp svneol=native#text/plain

View File

@ -2195,7 +2195,7 @@ begin
for i:=0 to length(s)-2 do { -2 because s contains explicit terminating #0 }
begin
nc:=s[i];
if (nc<$ffff) then
if (nc<=$ffff) then
dest^:=widechar(nc)
else if (dword(nc)<=$10ffff) then
begin

27
tests/webtbs/tw28593.pp Normal file
View File

@ -0,0 +1,27 @@
program tucs4toutf16FFFF;
{$H+}
uses
sysutils;
procedure halt_error(const AErrorCode : Integer; const AMsg : string);
begin
Write(AMsg);
Halt(AErrorCode);
end;
var
s4 : UCS4String;
us : UnicodeString;
begin
SetLength(s4,2);
s4[0] := $FFFF;
s4[1] := 0;
us := UCS4StringToUnicodeString(s4);
if (Length(us) <> 1) then
halt_error(1, 'A single code point UTF6 string expected.');
if (Ord(us[1]) <> $FFFF) then
halt_error(2, 'code point U+FFFF expected, got U+'+IntToHex(Ord(us[1]),4));
WriteLn('OK');
end.