mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-11-03 12:29:25 +01:00
determine the length of a multi-byte character. The return values
are defined to be the same as those of POSIX' mblen: -1 =
invalid/incomplete sequence, 0 = #0, > 0 = length of sequence in
bytes.
+ default implementation for widestringmanager.codepointlengthproc
(assumes all code points have length 1) and Unix implementation
(based on mb(r)len); Windows implementation is still required
* replaced default implementation of
widestringmanager.CharLengthPCharProc with strlen() of the input
instead of an error (correct if all code points have length 1,
still needs Windows implementation)
+ implemented fpc_text_read_{wide,unicode}str() and
fpc_text_read_widechar() (mantis #18163); fpc_text_read_widechar()
uses the new widestringmanager.codepointlengthproc()
+ unicodestring support for readstr/writestr
* fixed declaration of fpc_Write_Text_UnicodeStr (unicodestring
instead of widestring parameter)
* extended test/twide*.pp tests to test the new/fixed functionality
git-svn-id: trunk@16533 -
30 lines
402 B
ObjectPascal
30 lines
402 B
ObjectPascal
{$ifdef UNIX}
|
|
uses
|
|
cwstring;
|
|
{$endif UNIX}
|
|
|
|
var
|
|
i : longint;
|
|
w,w2 : widestring;
|
|
u,u2 : unicodestring;
|
|
a : ansistring;
|
|
|
|
begin
|
|
setlength(w,1000);
|
|
for i:=1 to 1000 do
|
|
w[i]:=widechar(i);
|
|
for i:=1 to 10 do
|
|
begin
|
|
a:=w;
|
|
w2:=a;
|
|
end;
|
|
setlength(u,1000);
|
|
for i:=1 to 1000 do
|
|
u[i]:=widechar(i);
|
|
for i:=1 to 10 do
|
|
begin
|
|
a:=u;
|
|
u2:=a;
|
|
end;
|
|
end.
|