mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-20 18:29:28 +02:00
* Use cp1251 on Android.
git-svn-id: trunk@31725 -
This commit is contained in:
parent
b6b072e030
commit
6e638e31d7
@ -7,8 +7,11 @@ uses
|
||||
{$endif}
|
||||
sysutils;
|
||||
|
||||
const
|
||||
RusCP = {$ifdef android} 1251 {$else} 866 {$endif};
|
||||
|
||||
type
|
||||
tcpstr866 = type ansistring(866);
|
||||
tcpstrRusCP = type ansistring(RusCP);
|
||||
|
||||
procedure error(const s: string);
|
||||
begin
|
||||
@ -27,7 +30,7 @@ end;
|
||||
procedure testsinglebyte;
|
||||
var
|
||||
u, u2,u3: utf8string;
|
||||
c,c2,c3: tcpstr866;
|
||||
c,c2,c3: tcpstrRusCP;
|
||||
f: file;
|
||||
begin
|
||||
u:='‹≈©◊';
|
||||
@ -54,30 +57,30 @@ begin
|
||||
Error('Removing utf8string dir');
|
||||
|
||||
c:='Русская';
|
||||
setcodepage(rawbytestring(c),866);
|
||||
setcodepage(rawbytestring(c),RusCP);
|
||||
assign(f,c);
|
||||
rewrite(f);
|
||||
if ioresult<>0 then
|
||||
Error('Creating cp866 file');
|
||||
Error('Creating cp'+IntToStr(RusCP)+' file');
|
||||
close(f);
|
||||
if ioresult<>0 then
|
||||
Error('Closing cp866 file');
|
||||
Error('Closing cp'+IntToStr(RusCP)+' file');
|
||||
c2:='кая';
|
||||
setcodepage(rawbytestring(c2),866);
|
||||
setcodepage(rawbytestring(c2),RusCP);
|
||||
mkdir(c2);
|
||||
if ioresult<>0 then
|
||||
Error('Creating cp866 dir');
|
||||
Error('Creating cp'+IntToStr(RusCP)+' dir');
|
||||
c3:=c2+'/Русская1';
|
||||
setcodepage(rawbytestring(c3),866);
|
||||
setcodepage(rawbytestring(c3),RusCP);
|
||||
rename(f,c3);
|
||||
if ioresult<>0 then
|
||||
Error('Renaming cp866 file');
|
||||
Error('Renaming cp'+IntToStr(RusCP)+' file');
|
||||
erase(f);
|
||||
if ioresult<>0 then
|
||||
Error('Erasing cp866 file');
|
||||
Error('Erasing cp'+IntToStr(RusCP)+' file');
|
||||
rmdir(c2);
|
||||
if ioresult<>0 then
|
||||
Error('Removing cp866 dir');
|
||||
Error('Removing cp'+IntToStr(RusCP)+' dir');
|
||||
end;
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user