mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-25 07:09:17 +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}
|
{$endif}
|
||||||
sysutils;
|
sysutils;
|
||||||
|
|
||||||
|
const
|
||||||
|
RusCP = {$ifdef android} 1251 {$else} 866 {$endif};
|
||||||
|
|
||||||
type
|
type
|
||||||
tcpstr866 = type ansistring(866);
|
tcpstrRusCP = type ansistring(RusCP);
|
||||||
|
|
||||||
procedure error(const s: string);
|
procedure error(const s: string);
|
||||||
begin
|
begin
|
||||||
@ -27,7 +30,7 @@ end;
|
|||||||
procedure testsinglebyte;
|
procedure testsinglebyte;
|
||||||
var
|
var
|
||||||
u, u2,u3: utf8string;
|
u, u2,u3: utf8string;
|
||||||
c,c2,c3: tcpstr866;
|
c,c2,c3: tcpstrRusCP;
|
||||||
f: file;
|
f: file;
|
||||||
begin
|
begin
|
||||||
u:='‹≈©◊';
|
u:='‹≈©◊';
|
||||||
@ -54,30 +57,30 @@ begin
|
|||||||
Error('Removing utf8string dir');
|
Error('Removing utf8string dir');
|
||||||
|
|
||||||
c:='Русская';
|
c:='Русская';
|
||||||
setcodepage(rawbytestring(c),866);
|
setcodepage(rawbytestring(c),RusCP);
|
||||||
assign(f,c);
|
assign(f,c);
|
||||||
rewrite(f);
|
rewrite(f);
|
||||||
if ioresult<>0 then
|
if ioresult<>0 then
|
||||||
Error('Creating cp866 file');
|
Error('Creating cp'+IntToStr(RusCP)+' file');
|
||||||
close(f);
|
close(f);
|
||||||
if ioresult<>0 then
|
if ioresult<>0 then
|
||||||
Error('Closing cp866 file');
|
Error('Closing cp'+IntToStr(RusCP)+' file');
|
||||||
c2:='кая';
|
c2:='кая';
|
||||||
setcodepage(rawbytestring(c2),866);
|
setcodepage(rawbytestring(c2),RusCP);
|
||||||
mkdir(c2);
|
mkdir(c2);
|
||||||
if ioresult<>0 then
|
if ioresult<>0 then
|
||||||
Error('Creating cp866 dir');
|
Error('Creating cp'+IntToStr(RusCP)+' dir');
|
||||||
c3:=c2+'/Русская1';
|
c3:=c2+'/Русская1';
|
||||||
setcodepage(rawbytestring(c3),866);
|
setcodepage(rawbytestring(c3),RusCP);
|
||||||
rename(f,c3);
|
rename(f,c3);
|
||||||
if ioresult<>0 then
|
if ioresult<>0 then
|
||||||
Error('Renaming cp866 file');
|
Error('Renaming cp'+IntToStr(RusCP)+' file');
|
||||||
erase(f);
|
erase(f);
|
||||||
if ioresult<>0 then
|
if ioresult<>0 then
|
||||||
Error('Erasing cp866 file');
|
Error('Erasing cp'+IntToStr(RusCP)+' file');
|
||||||
rmdir(c2);
|
rmdir(c2);
|
||||||
if ioresult<>0 then
|
if ioresult<>0 then
|
||||||
Error('Removing cp866 dir');
|
Error('Removing cp'+IntToStr(RusCP)+' dir');
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user