mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-29 23:40:14 +02:00
* Use CP_ASCII as fallback in GetSystemCodepage to be compatible with cwstring.
git-svn-id: trunk@23676 -
This commit is contained in:
parent
1421998752
commit
c4ba95b227
@ -702,14 +702,14 @@ var
|
|||||||
lang: ansistring;
|
lang: ansistring;
|
||||||
begin
|
begin
|
||||||
// Get one of non-empty environment variables in the next order:
|
// Get one of non-empty environment variables in the next order:
|
||||||
// LC_ALL, LC_CTYPE, LANG. Default is CP_UTF8.
|
// LC_ALL, LC_CTYPE, LANG. Default is ASCII.
|
||||||
lang:=FpGetEnv('LC_ALL');
|
lang:=FpGetEnv('LC_ALL');
|
||||||
if lang='' then
|
if lang='' then
|
||||||
lang:=FpGetEnv('LC_CTYPE');
|
lang:=FpGetEnv('LC_CTYPE');
|
||||||
if lang='' then
|
if lang='' then
|
||||||
lang:=FpGetEnv('LANG');
|
lang:=FpGetEnv('LANG');
|
||||||
if lang='' then
|
if lang='' then
|
||||||
Result:=CP_UTF8
|
Result:=CP_ASCII
|
||||||
else
|
else
|
||||||
begin
|
begin
|
||||||
// clean up, for example en_US.UTF-8 => UTF-8
|
// clean up, for example en_US.UTF-8 => UTF-8
|
||||||
@ -719,7 +719,7 @@ begin
|
|||||||
if p>0 then Delete(lang,p,length(lang)-p+1);
|
if p>0 then Delete(lang,p,length(lang)-p+1);
|
||||||
Result:=GetCodepageByName(lang);
|
Result:=GetCodepageByName(lang);
|
||||||
if Result = CP_NONE then
|
if Result = CP_NONE then
|
||||||
Result:=CP_UTF8;
|
Result:=CP_ASCII;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user