mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-24 04:39:10 +02:00
* also allow 'cpXXXX' in addition to 'CPXXXX' code page names (mantis #15169)
git-svn-id: trunk@26148 -
This commit is contained in:
parent
5e129b4ac5
commit
cddc31a1a8
1
.gitattributes
vendored
1
.gitattributes
vendored
@ -12314,6 +12314,7 @@ tests/tstunits/Makefile.fpc svneol=native#text/plain
|
||||
tests/tstunits/erroru.pp svneol=native#text/plain
|
||||
tests/tstunits/popuperr.pp svneol=native#text/plain
|
||||
tests/tstunits/win32err.pp svneol=native#text/plain
|
||||
tests/tw15169.pp svneol=native#text/plain
|
||||
tests/utils/Makefile svneol=native#text/plain
|
||||
tests/utils/Makefile.fpc svneol=native#text/plain
|
||||
tests/utils/avx/asmtestgenerator.pas svneol=native#text/plain
|
||||
|
@ -681,6 +681,16 @@ begin
|
||||
ansistring (encoding names are always ascii) }
|
||||
SetCodePage(cpname,$ffff,false);
|
||||
|
||||
{ Linux uses cpXXXX instead of CPXXXX }
|
||||
if (length(cpname)>2) and
|
||||
(cpname[1]='c') and
|
||||
(cpname[2]='p') and
|
||||
(cpname[3] in ['0'..'9']) then
|
||||
begin
|
||||
cpname[1]:='C';
|
||||
cpname[2]:='P';
|
||||
end;
|
||||
|
||||
{ simple linear scan, not a common operation and hence not worth
|
||||
building a separate array for -- start from index 1 rather than
|
||||
0, because 0 = fake "code page 0" that maps to UTF-8 as default
|
||||
|
10
tests/tw15169.pp
Normal file
10
tests/tw15169.pp
Normal file
@ -0,0 +1,10 @@
|
||||
{ %platform=darwin,linux,freebsd,openbsd,netbsd,solaris }
|
||||
|
||||
uses
|
||||
unixcp;
|
||||
begin
|
||||
if GetCodepageByName('cp1250')<>1250 then
|
||||
halt(1);
|
||||
if GetCodepageByName('CP1250')<>1250 then
|
||||
halt(2);
|
||||
end.
|
Loading…
Reference in New Issue
Block a user