Browse Source

rtl: setup DefaultSystemCodepage when fpwidestring is included on unixes

git-svn-id: trunk@23768 -
paul 12 years ago
parent
commit
23c9578137
1 changed files with 4 additions and 0 deletions
  1. 4 0
      rtl/objpas/fpwidestring.pp

+ 4 - 0
rtl/objpas/fpwidestring.pp

@@ -18,6 +18,9 @@ uses
 {$ifdef MSWINDOWS}
 {$ifdef MSWINDOWS}
   Windows,
   Windows,
 {$endif MSWINDOWS}
 {$endif MSWINDOWS}
+{$ifdef Unix}
+  unixcp,
+{$endif}
   sysutils, character, charset;
   sysutils, character, charset;
   
   
 procedure fpc_rangeerror; [external name 'FPC_RANGEERROR'];
 procedure fpc_rangeerror; [external name 'FPC_RANGEERROR'];
@@ -806,6 +809,7 @@ begin
   DefaultSystemCodePage:=GetACP();
   DefaultSystemCodePage:=GetACP();
 {$endif MSWINDOWS}
 {$endif MSWINDOWS}
 {$ifdef UNIX}
 {$ifdef UNIX}
+  DefaultSystemCodePage:=GetSystemCodepage;
   if (DefaultSystemCodePage = CP_NONE) then
   if (DefaultSystemCodePage = CP_NONE) then
     DefaultSystemCodePage:=CP_UTF8;
     DefaultSystemCodePage:=CP_UTF8;
 {$endif UNIX}
 {$endif UNIX}