fpc/tests/test/twrstr9.pp
yury d106fc9823 * Use cp1251 on Android.
git-svn-id: trunk@31723 -
2015-09-16 17:35:22 +00:00

34 lines
754 B
ObjectPascal
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

{$codepage utf8}
{$ifdef unix}
uses
{$ifdef darwin}iosxwstr{$else}cwstring{$endif};
{$endif}
type
ts866 = type ansistring( {$ifdef android} 1251 {$else} 866 {$endif} );
var
u: unicodestring;
s: utf8string;
rs: ts866;
p: pointer;
i: longint;
begin
DefaultSystemCodePage:=CP_ASCII;
s:='§èà£ù';
rs:=ts866('Популярные фото');
writestr(u,s,1,s,rs);
if u <>'§èà£ù1§èà£ùПопулярные фото' then
halt(1);
getmem(p,length(s)-1);
s:='';
for i:=1 to (256 div 3) do
s:=s+utf8string('㒨');
s:=s+utf8string('㒨');
{ check that splitting the last 㒨 into two parts during writestr doesn't cause a
conversion error }
writestr(u,s);
if utf8string(u)<>s then
halt(2);
end.