mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-20 11:09:42 +02:00
--- 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:
parent
f2e27b2585
commit
aef7142f34
1
.gitattributes
vendored
1
.gitattributes
vendored
@ -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
|
||||
|
@ -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
27
tests/webtbs/tw28593.pp
Normal 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.
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user