浏览代码

* checked r22466. Most remaining mutations added. With the exception of sysunix.inc.

git-svn-id: branches/unicode@24885 -
marco 12 年之前
父节点
当前提交
db7f4eccc2

+ 30 - 0
.gitattributes

@@ -7417,6 +7417,7 @@ rtl/aix/osmacro.inc svneol=native#text/plain
 rtl/aix/ostypes.inc svneol=native#text/plain
 rtl/aix/pthread.inc svneol=native#text/plain
 rtl/aix/ptypes.inc svneol=native#text/plain
+rtl/aix/rtldefs.inc svneol=native#text/plain
 rtl/aix/sighnd.inc svneol=native#text/plain
 rtl/aix/sighndh.inc svneol=native#text/plain
 rtl/aix/signal.inc svneol=native#text/plain
@@ -7451,6 +7452,7 @@ rtl/amiga/powerpc/utild1.inc svneol=native#text/plain
 rtl/amiga/powerpc/utild2.inc svneol=native#text/plain
 rtl/amiga/powerpc/utilf.inc svneol=native#text/plain
 rtl/amiga/printer.pp svneol=native#text/plain
+rtl/amiga/rtldefs.inc svneol=native#text/plain
 rtl/amiga/sysdir.inc svneol=native#text/plain
 rtl/amiga/sysfile.inc svneol=native#text/plain
 rtl/amiga/sysheap.inc svneol=native#text/plain
@@ -7493,6 +7495,7 @@ rtl/arm/thumb2.inc svneol=native#text/plain
 rtl/atari/os.inc svneol=native#text/plain
 rtl/atari/prt0.as svneol=native#text/plain
 rtl/atari/readme -text
+rtl/atari/rtldefs.inc svneol=native#text/plain
 rtl/atari/sysatari.pas svneol=native#text/plain
 rtl/atari/system.pas svneol=native#text/plain
 rtl/avr/avr.inc svneol=native#text/plain
@@ -7520,6 +7523,7 @@ rtl/beos/osmacro.inc svneol=native#text/plain
 rtl/beos/ossysc.inc svneol=native#text/plain
 rtl/beos/ostypes.inc svneol=native#text/plain
 rtl/beos/ptypes.inc svneol=native#text/plain
+rtl/beos/rtldefs.inc svneol=native#text/plain
 rtl/beos/settimeo.inc svneol=native#text/plain
 rtl/beos/signal.inc svneol=native#text/plain
 rtl/beos/suuid.inc svneol=native#text/plain
@@ -7601,6 +7605,7 @@ rtl/darwin/ppcgen/ppchnd.inc svneol=native#text/plain
 rtl/darwin/ppcgen/sig_ppc.inc svneol=native#text/plain
 rtl/darwin/pthread.inc svneol=native#text/plain
 rtl/darwin/ptypes.inc svneol=native#text/plain
+rtl/darwin/rtldefs.inc svneol=native#text/plain
 rtl/darwin/signal.inc svneol=native#text/plain
 rtl/darwin/sysctlh.inc svneol=native#text/plain
 rtl/darwin/termio.pp svneol=native#text/plain
@@ -7664,6 +7669,7 @@ rtl/emx/emxwrap.imp -text
 rtl/emx/ports.pas svneol=native#text/plain
 rtl/emx/prt0.as svneol=native#text/plain
 rtl/emx/prt1.as svneol=native#text/plain
+rtl/emx/rtldefs.inc svneol=native#text/plain
 rtl/emx/sysdir.inc svneol=native#text/plain
 rtl/emx/sysemx.pas svneol=native#text/plain
 rtl/emx/sysfile.inc svneol=native#text/plain
@@ -7698,6 +7704,7 @@ rtl/freebsd/i386/x86h.inc svneol=native#text/plain
 rtl/freebsd/pmutext.inc svneol=native#text/plain
 rtl/freebsd/pthread.inc svneol=native#text/plain
 rtl/freebsd/ptypes.inc svneol=native#text/plain
+rtl/freebsd/rtldefs.inc svneol=native#text/plain
 rtl/freebsd/si_crt.pp svneol=native#text/plain
 rtl/freebsd/si_intf.inc svneol=native#text/plain
 rtl/freebsd/signal.inc svneol=native#text/plain
@@ -7729,6 +7736,7 @@ rtl/gba/gbabiosh.inc svneol=native#text/plain
 rtl/gba/libc.inc svneol=native#text/plain
 rtl/gba/libch.inc svneol=native#text/plain
 rtl/gba/prt0.as svneol=native#text/plain
+rtl/gba/rtldefs.inc svneol=native#text/plain
 rtl/gba/sysdir.inc svneol=native#text/plain
 rtl/gba/sysfile.inc svneol=native#text/plain
 rtl/gba/sysheap.inc svneol=native#text/plain
@@ -7761,6 +7769,7 @@ rtl/go32v2/msmouse.pp svneol=native#text/plain
 rtl/go32v2/ports.pp svneol=native#text/plain
 rtl/go32v2/printer.pp svneol=native#text/plain
 rtl/go32v2/profile.pp svneol=native#text/plain
+rtl/go32v2/rtldefs.inc svneol=native#text/plain
 rtl/go32v2/sbrk16.ah -text
 rtl/go32v2/sbrk16.asm -text
 rtl/go32v2/sysdir.inc svneol=native#text/plain
@@ -7794,6 +7803,7 @@ rtl/haiku/ossysc.inc svneol=native#text/plain
 rtl/haiku/ostypes.inc svneol=native#text/plain
 rtl/haiku/pthread.inc svneol=native#text/plain
 rtl/haiku/ptypes.inc svneol=native#text/plain
+rtl/haiku/rtldefs.inc svneol=native#text/plain
 rtl/haiku/settimeo.inc svneol=native#text/plain
 rtl/haiku/signal.inc svneol=native#text/plain
 rtl/haiku/suuid.inc svneol=native#text/plain
@@ -7974,6 +7984,7 @@ rtl/java/objpas.inc svneol=native#text/plain
 rtl/java/objpas.pp svneol=native#text/plain
 rtl/java/objpash.inc svneol=native#text/plain
 rtl/java/rtl.cfg svneol=native#text/plain
+rtl/java/rtldefs.inc svneol=native#text/plain
 rtl/java/rtti.inc svneol=native#text/plain
 rtl/java/sysos.inc svneol=native#text/plain
 rtl/java/sysosh.inc svneol=native#text/plain
@@ -8098,6 +8109,7 @@ rtl/linux/powerpc64/syscallh.inc svneol=native#text/plain
 rtl/linux/powerpc64/sysnr.inc svneol=native#text/plain
 rtl/linux/pthread.inc svneol=native#text/plain
 rtl/linux/ptypes.inc svneol=native#text/plain
+rtl/linux/rtldefs.inc svneol=native#text/plain
 rtl/linux/si_c.pp svneol=native#text/plain
 rtl/linux/si_c21.pp svneol=native#text/plain
 rtl/linux/si_c21g.pp svneol=native#text/plain
@@ -8169,6 +8181,7 @@ rtl/macos/macostp.inc svneol=native#text/plain
 rtl/macos/macostp.pp svneol=native#text/plain
 rtl/macos/macutils.inc svneol=native#text/plain
 rtl/macos/macutils.pp svneol=native#text/plain
+rtl/macos/rtldefs.inc svneol=native#text/plain
 rtl/macos/sysdir.inc svneol=native#text/plain
 rtl/macos/sysfile.inc svneol=native#text/plain
 rtl/macos/sysheap.inc svneol=native#text/plain
@@ -8227,6 +8240,7 @@ rtl/morphos/mouse.pp svneol=native#text/plain
 rtl/morphos/mui.pas -text svneol=unset#text/plain
 rtl/morphos/muihelper.pas -text svneol=unset#text/plain
 rtl/morphos/prt0.as svneol=native#text/plain
+rtl/morphos/rtldefs.inc svneol=native#text/plain
 rtl/morphos/sockets.pp svneol=native#text/plain
 rtl/morphos/sysdir.inc svneol=native#text/plain
 rtl/morphos/sysfile.inc svneol=native#text/plain
@@ -8287,6 +8301,7 @@ rtl/nativent/ndk/rtltypes.inc svneol=native#text/plain
 rtl/nativent/ndk/umtypes.inc svneol=native#text/plain
 rtl/nativent/ndk/winnt.inc svneol=native#text/plain
 rtl/nativent/ndkutils.pas svneol=native#text/pascal
+rtl/nativent/rtldefs.inc svneol=native#text/plain
 rtl/nativent/sysdir.inc svneol=native#text/plain
 rtl/nativent/sysfile.inc svneol=native#text/plain
 rtl/nativent/sysheap.inc svneol=native#text/plain
@@ -8311,6 +8326,7 @@ rtl/nds/ndsbiosh.inc svneol=native#text/plain
 rtl/nds/ndsh.inc svneol=native#text/plain
 rtl/nds/prt07.as svneol=native#text/plain
 rtl/nds/prt09.as svneol=native#text/plain
+rtl/nds/rtldefs.inc svneol=native#text/plain
 rtl/nds/sysdir.inc svneol=native#text/plain
 rtl/nds/sysfile.inc svneol=native#text/plain
 rtl/nds/sysheap.inc svneol=native#text/plain
@@ -8338,6 +8354,7 @@ rtl/netbsd/powerpc/prt0.as svneol=native#text/plain
 rtl/netbsd/powerpc/sighnd.inc svneol=native#text/plain
 rtl/netbsd/pthread.inc svneol=native#text/plain
 rtl/netbsd/ptypes.inc svneol=native#text/plain
+rtl/netbsd/rtldefs.inc svneol=native#text/plain
 rtl/netbsd/signal.inc svneol=native#text/plain
 rtl/netbsd/syscalls.inc svneol=native#text/plain
 rtl/netbsd/sysconst.inc svneol=native#text/plain
@@ -8412,6 +8429,7 @@ rtl/netware/nwsys.inc svneol=native#text/plain
 rtl/netware/prelude.as svneol=native#text/plain
 rtl/netware/qos.inc svneol=native#text/plain
 rtl/netware/requestr.imp -text
+rtl/netware/rtldefs.inc svneol=native#text/plain
 rtl/netware/sockets.pp svneol=native#text/plain
 rtl/netware/socklib.imp -text
 rtl/netware/streams.imp -text
@@ -8456,6 +8474,7 @@ rtl/netwlibc/nwsnut.imp -text
 rtl/netwlibc/nwsnut.pp svneol=native#text/plain
 rtl/netwlibc/pre/libcpre.gcc.o -text
 rtl/netwlibc/qos.inc svneol=native#text/plain
+rtl/netwlibc/rtldefs.inc svneol=native#text/plain
 rtl/netwlibc/sockets.pp svneol=native#text/plain
 rtl/netwlibc/sysdir.inc svneol=native#text/plain
 rtl/netwlibc/sysfile.inc svneol=native#text/plain
@@ -8599,6 +8618,7 @@ rtl/openbsd/osdefs.inc svneol=native#text/plain
 rtl/openbsd/pmutext.inc svneol=native#text/plain
 rtl/openbsd/pthread.inc svneol=native#text/plain
 rtl/openbsd/ptypes.inc svneol=native#text/plain
+rtl/openbsd/rtldefs.inc svneol=native#text/plain
 rtl/openbsd/signal.inc svneol=native#text/plain
 rtl/openbsd/syscalls.inc svneol=native#text/plain
 rtl/openbsd/sysconst.inc svneol=native#text/plain
@@ -8651,6 +8671,7 @@ rtl/os2/pmwsock.pas svneol=native#text/plain
 rtl/os2/ports.pas svneol=native#text/plain
 rtl/os2/printer.pas svneol=native#text/plain
 rtl/os2/prt0.as svneol=native#text/plain
+rtl/os2/rtldefs.inc svneol=native#text/plain
 rtl/os2/so32dll.pas svneol=native#text/plain
 rtl/os2/sockets.pas svneol=native#text/plain
 rtl/os2/sysdir.inc svneol=native#text/plain
@@ -8706,6 +8727,7 @@ rtl/palmos/m68k/prt0.as svneol=native#text/plain
 rtl/palmos/os.inc svneol=native#text/plain
 rtl/palmos/pilot.pp svneol=native#text/plain
 rtl/palmos/readme -text
+rtl/palmos/rtldefs.inc svneol=native#text/plain
 rtl/palmos/syspalm.pp svneol=native#text/plain
 rtl/palmos/system.pp svneol=native#text/plain
 rtl/palmos/systraps.pp svneol=native#text/plain
@@ -8746,6 +8768,7 @@ rtl/qnx/osposix.inc svneol=native#text/plain
 rtl/qnx/osposixh.inc svneol=native#text/plain
 rtl/qnx/posix.pp svneol=native#text/plain
 rtl/qnx/qnx.inc svneol=native#text/plain
+rtl/qnx/rtldefs.inc svneol=native#text/plain
 rtl/qnx/signal.inc svneol=native#text/plain
 rtl/qnx/system.pp svneol=native#text/plain
 rtl/solaris/Makefile svneol=native#text/plain
@@ -8761,6 +8784,7 @@ rtl/solaris/osmacro.inc svneol=native#text/plain
 rtl/solaris/ostypes.inc svneol=native#text/plain
 rtl/solaris/pthread.inc svneol=native#text/plain
 rtl/solaris/ptypes.inc svneol=native#text/plain
+rtl/solaris/rtldefs.inc svneol=native#text/plain
 rtl/solaris/signal.inc svneol=native#text/plain
 rtl/solaris/sparc/sighnd.inc svneol=native#text/plain
 rtl/solaris/sparc/sighndh.inc svneol=native#text/plain
@@ -8793,6 +8817,7 @@ rtl/symbian/Makefile svneol=native#text/plain
 rtl/symbian/Makefile.fpc svneol=native#text/plain
 rtl/symbian/bindings/pbeexe.cpp -text
 rtl/symbian/buildrtl.pp svneol=native#text/plain
+rtl/symbian/rtldefs.inc svneol=native#text/plain
 rtl/symbian/symbian.pas svneol=native#text/plain
 rtl/symbian/symbianinc/e32def.inc svneol=native#text/plain
 rtl/symbian/symbianinc/e32err.inc svneol=native#text/plain
@@ -8891,6 +8916,7 @@ rtl/watcom/classes.pp svneol=native#text/plain
 rtl/watcom/crt.pp svneol=native#text/plain
 rtl/watcom/dos.pp svneol=native#text/plain
 rtl/watcom/prt0.as -text
+rtl/watcom/rtldefs.inc svneol=native#text/plain
 rtl/watcom/sysdir.inc svneol=native#text/plain
 rtl/watcom/sysfile.inc svneol=native#text/plain
 rtl/watcom/sysheap.inc svneol=native#text/plain
@@ -8906,6 +8932,7 @@ rtl/wii/classes.pp svneol=native#text/plain
 rtl/wii/dos.pp svneol=native#text/plain
 rtl/wii/libc.inc svneol=native#text/plain
 rtl/wii/libch.inc svneol=native#text/plain
+rtl/wii/rtldefs.inc svneol=native#text/plain
 rtl/wii/sysdir.inc svneol=native#text/plain
 rtl/wii/sysfile.inc svneol=native#text/plain
 rtl/wii/sysheap.inc svneol=native#text/plain
@@ -8969,6 +8996,7 @@ rtl/win32/classes.pp svneol=native#text/plain
 rtl/win32/gprt0.as svneol=native#text/plain
 rtl/win32/initc.pp svneol=native#text/plain
 rtl/win32/objinc.inc svneol=native#text/plain
+rtl/win32/rtldefs.inc svneol=native#text/plain
 rtl/win32/signals.pp svneol=native#text/plain
 rtl/win32/sysinit.inc svneol=native#text/plain
 rtl/win32/sysinitcyg.pp svneol=native#text/plain
@@ -8984,6 +9012,7 @@ rtl/win64/Makefile svneol=native#text/plain
 rtl/win64/Makefile.fpc svneol=native#text/plain
 rtl/win64/buildrtl.pp svneol=native#text/plain
 rtl/win64/classes.pp svneol=native#text/plain
+rtl/win64/rtldefs.inc svneol=native#text/plain
 rtl/win64/seh64.inc svneol=native#text/plain
 rtl/win64/signals.pp svneol=native#text/plain
 rtl/win64/system.pp svneol=native#text/plain
@@ -8995,6 +9024,7 @@ rtl/wince/dos.pp svneol=native#text/plain
 rtl/wince/dynlibs.inc svneol=native#text/plain
 rtl/wince/messages.pp svneol=native#text/plain
 rtl/wince/readme.txt svneol=native#text/plain
+rtl/wince/rtldefs.inc svneol=native#text/plain
 rtl/wince/system.pp svneol=native#text/plain
 rtl/wince/sysutils.pp svneol=native#text/plain
 rtl/wince/varutils.pp svneol=native#text/plain

+ 18 - 0
rtl/aix/rtldefs.inc

@@ -0,0 +1,18 @@
+{
+    This file is part of the Free Pascal run time library.
+    Copyright (c) 2012 by Free Pascal development team
+
+    This file contains platform-specific defines that are used in
+    multiple RTL units.
+
+    See the file COPYING.FPC, included in this distribution,
+    for details about the copyright.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+ **********************************************************************}
+
+{ the single byte OS APIs always use UTF-8 }
+{ define FPCRTL_FILESYSTEM_UTF8}

+ 18 - 0
rtl/amiga/rtldefs.inc

@@ -0,0 +1,18 @@
+{
+    This file is part of the Free Pascal run time library.
+    Copyright (c) 2012 by Free Pascal development team
+
+    This file contains platform-specific defines that are used in
+    multiple RTL units.
+
+    See the file COPYING.FPC, included in this distribution,
+    for details about the copyright.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+ **********************************************************************}
+
+{ the single byte OS APIs always use UTF-8 }
+{ define FPCRTL_FILESYSTEM_UTF8}

+ 18 - 0
rtl/atari/rtldefs.inc

@@ -0,0 +1,18 @@
+{
+    This file is part of the Free Pascal run time library.
+    Copyright (c) 2012 by Free Pascal development team
+
+    This file contains platform-specific defines that are used in
+    multiple RTL units.
+
+    See the file COPYING.FPC, included in this distribution,
+    for details about the copyright.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+ **********************************************************************}
+
+{ the single byte OS APIs always use UTF-8 }
+{ define FPCRTL_FILESYSTEM_UTF8}

+ 18 - 0
rtl/beos/rtldefs.inc

@@ -0,0 +1,18 @@
+{
+    This file is part of the Free Pascal run time library.
+    Copyright (c) 2012 by Free Pascal development team
+
+    This file contains platform-specific defines that are used in
+    multiple RTL units.
+
+    See the file COPYING.FPC, included in this distribution,
+    for details about the copyright.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+ **********************************************************************}
+
+{ the single byte OS APIs always use UTF-8 }
+{ define FPCRTL_FILESYSTEM_UTF8}

+ 18 - 0
rtl/darwin/rtldefs.inc

@@ -0,0 +1,18 @@
+{
+    This file is part of the Free Pascal run time library.
+    Copyright (c) 2012 by Free Pascal development team
+
+    This file contains platform-specific defines that are used in
+    multiple RTL units.
+
+    See the file COPYING.FPC, included in this distribution,
+    for details about the copyright.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+ **********************************************************************}
+
+{ the single byte OS APIs always use UTF-8 }
+{$define FPCRTL_FILESYSTEM_UTF8}

+ 18 - 0
rtl/emx/rtldefs.inc

@@ -0,0 +1,18 @@
+{
+    This file is part of the Free Pascal run time library.
+    Copyright (c) 2012 by Free Pascal development team
+
+    This file contains platform-specific defines that are used in
+    multiple RTL units.
+
+    See the file COPYING.FPC, included in this distribution,
+    for details about the copyright.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+ **********************************************************************}
+
+{ the single byte OS APIs always use UTF-8 }
+{ define FPCRTL_FILESYSTEM_UTF8}

+ 18 - 0
rtl/freebsd/rtldefs.inc

@@ -0,0 +1,18 @@
+{
+    This file is part of the Free Pascal run time library.
+    Copyright (c) 2012 by Free Pascal development team
+
+    This file contains platform-specific defines that are used in
+    multiple RTL units.
+
+    See the file COPYING.FPC, included in this distribution,
+    for details about the copyright.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+ **********************************************************************}
+
+{ the single byte OS APIs always use UTF-8 }
+{ define FPCRTL_FILESYSTEM_UTF8}

+ 18 - 0
rtl/gba/rtldefs.inc

@@ -0,0 +1,18 @@
+{
+    This file is part of the Free Pascal run time library.
+    Copyright (c) 2012 by Free Pascal development team
+
+    This file contains platform-specific defines that are used in
+    multiple RTL units.
+
+    See the file COPYING.FPC, included in this distribution,
+    for details about the copyright.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+ **********************************************************************}
+
+{ the single byte OS APIs always use UTF-8 }
+{ define FPCRTL_FILESYSTEM_UTF8}

+ 18 - 0
rtl/go32v2/rtldefs.inc

@@ -0,0 +1,18 @@
+{
+    This file is part of the Free Pascal run time library.
+    Copyright (c) 2012 by Free Pascal development team
+
+    This file contains platform-specific defines that are used in
+    multiple RTL units.
+
+    See the file COPYING.FPC, included in this distribution,
+    for details about the copyright.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+ **********************************************************************}
+
+{ the single byte OS APIs always use UTF-8 }
+{ define FPCRTL_FILESYSTEM_UTF8}

+ 18 - 0
rtl/haiku/rtldefs.inc

@@ -0,0 +1,18 @@
+{
+    This file is part of the Free Pascal run time library.
+    Copyright (c) 2012 by Free Pascal development team
+
+    This file contains platform-specific defines that are used in
+    multiple RTL units.
+
+    See the file COPYING.FPC, included in this distribution,
+    for details about the copyright.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+ **********************************************************************}
+
+{ the single byte OS APIs always use UTF-8 }
+{ define FPCRTL_FILESYSTEM_UTF8}

+ 12 - 0
rtl/inc/astrings.inc

@@ -1425,3 +1425,15 @@ procedure SetMultiByteRTLFileSystemCodePage(CodePage: TSystemCodePage);
     DefaultRTLFileSystemCodePage:=CodePage;
   end;
 
+
+procedure SetMultiByteFileSystemCodePage(CodePage: TSystemCodePage);
+  begin
+    DefaultFileSystemCodePage:=CodePage;
+  end;
+
+
+procedure SetMultiByteRTLFileSystemCodePage(CodePage: TSystemCodePage);
+  begin
+    DefaultRTLFileSystemCodePage:=CodePage;
+  end;
+

+ 4 - 1
rtl/inc/systemh.inc

@@ -447,9 +447,12 @@ Type
 { procedure type }
   TProcedure  = Procedure;
 
-{ platform dependent types }
+{ platform-dependent types }
 {$i sysosh.inc}
 
+{ platform-dependent defines }
+{$i rtldefs.inc}
+
 {*****************************************************************************
                    TextRec/FileRec exported to allow compiler to take size
 *****************************************************************************}

+ 7 - 0
rtl/java/jsystemh_types.inc

@@ -533,6 +533,13 @@ var
 
   DefaultSystemCodePage,
   DefaultUnicodeCodePage,
+  { the code page to use when sending paths/file names to OS file system API
+    calls using single byte strings, and to interpret the results gotten back
+    from such API calls }
+  DefaultFileSystemCodePage,
+  { the code page to use to return file names from single byte file system calls
+    in the RTL that return ansistrings (by default, same as a above) }
+  DefaultRTLFileSystemCodePage,
   UTF8CompareLocale : TSystemCodePage;
 
 

+ 2 - 0
rtl/java/justrings.inc

@@ -1009,6 +1009,8 @@ class constructor TUnicodeStringManager.ClassCreate;
       stdin etc, so setting this to utf-8 or so won't help) }
     if DefaultSystemCodePage=65535 then
       DefaultSystemCodePage:=20127;
+    DefaultFileSystemCodePage:=DefaultSystemCodePage;
+    DefaultRTLFileSystemCodePage:=DefaultFileSystemCodePage;
     DefaultUnicodeCodePage:=CP_UTF16BE;
   end;
 

+ 18 - 0
rtl/java/rtldefs.inc

@@ -0,0 +1,18 @@
+{
+    This file is part of the Free Pascal run time library.
+    Copyright (c) 2012 by Free Pascal development team
+
+    This file contains platform-specific defines that are used in
+    multiple RTL units.
+
+    See the file COPYING.FPC, included in this distribution,
+    for details about the copyright.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+ **********************************************************************}
+
+{ the single byte OS APIs always use UTF-8 }
+{ define FPCRTL_FILESYSTEM_UTF8}

+ 18 - 0
rtl/linux/rtldefs.inc

@@ -0,0 +1,18 @@
+{
+    This file is part of the Free Pascal run time library.
+    Copyright (c) 2012 by Free Pascal development team
+
+    This file contains platform-specific defines that are used in
+    multiple RTL units.
+
+    See the file COPYING.FPC, included in this distribution,
+    for details about the copyright.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+ **********************************************************************}
+
+{ the single byte OS APIs always use UTF-8 }
+{ define FPCRTL_FILESYSTEM_UTF8}

+ 18 - 0
rtl/macos/rtldefs.inc

@@ -0,0 +1,18 @@
+{
+    This file is part of the Free Pascal run time library.
+    Copyright (c) 2012 by Free Pascal development team
+
+    This file contains platform-specific defines that are used in
+    multiple RTL units.
+
+    See the file COPYING.FPC, included in this distribution,
+    for details about the copyright.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+ **********************************************************************}
+
+{ the single byte OS APIs always use UTF-8 }
+{ define FPCRTL_FILESYSTEM_UTF8}

+ 18 - 0
rtl/morphos/rtldefs.inc

@@ -0,0 +1,18 @@
+{
+    This file is part of the Free Pascal run time library.
+    Copyright (c) 2012 by Free Pascal development team
+
+    This file contains platform-specific defines that are used in
+    multiple RTL units.
+
+    See the file COPYING.FPC, included in this distribution,
+    for details about the copyright.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+ **********************************************************************}
+
+{ the single byte OS APIs always use UTF-8 }
+{ define FPCRTL_FILESYSTEM_UTF8}

+ 18 - 0
rtl/nativent/rtldefs.inc

@@ -0,0 +1,18 @@
+{
+    This file is part of the Free Pascal run time library.
+    Copyright (c) 2012 by Free Pascal development team
+
+    This file contains platform-specific defines that are used in
+    multiple RTL units.
+
+    See the file COPYING.FPC, included in this distribution,
+    for details about the copyright.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+ **********************************************************************}
+
+{ the single byte OS APIs always use UTF-8 }
+{ define FPCRTL_FILESYSTEM_UTF8}

+ 18 - 0
rtl/nds/rtldefs.inc

@@ -0,0 +1,18 @@
+{
+    This file is part of the Free Pascal run time library.
+    Copyright (c) 2012 by Free Pascal development team
+
+    This file contains platform-specific defines that are used in
+    multiple RTL units.
+
+    See the file COPYING.FPC, included in this distribution,
+    for details about the copyright.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+ **********************************************************************}
+
+{ the single byte OS APIs always use UTF-8 }
+{ define FPCRTL_FILESYSTEM_UTF8}

+ 18 - 0
rtl/netbsd/rtldefs.inc

@@ -0,0 +1,18 @@
+{
+    This file is part of the Free Pascal run time library.
+    Copyright (c) 2012 by Free Pascal development team
+
+    This file contains platform-specific defines that are used in
+    multiple RTL units.
+
+    See the file COPYING.FPC, included in this distribution,
+    for details about the copyright.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+ **********************************************************************}
+
+{ the single byte OS APIs always use UTF-8 }
+{ define FPCRTL_FILESYSTEM_UTF8}

+ 18 - 0
rtl/netware/rtldefs.inc

@@ -0,0 +1,18 @@
+{
+    This file is part of the Free Pascal run time library.
+    Copyright (c) 2012 by Free Pascal development team
+
+    This file contains platform-specific defines that are used in
+    multiple RTL units.
+
+    See the file COPYING.FPC, included in this distribution,
+    for details about the copyright.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+ **********************************************************************}
+
+{ the single byte OS APIs always use UTF-8 }
+{ define FPCRTL_FILESYSTEM_UTF8}

+ 18 - 0
rtl/netwlibc/rtldefs.inc

@@ -0,0 +1,18 @@
+{
+    This file is part of the Free Pascal run time library.
+    Copyright (c) 2012 by Free Pascal development team
+
+    This file contains platform-specific defines that are used in
+    multiple RTL units.
+
+    See the file COPYING.FPC, included in this distribution,
+    for details about the copyright.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+ **********************************************************************}
+
+{ the single byte OS APIs always use UTF-8 }
+{ define FPCRTL_FILESYSTEM_UTF8}

+ 18 - 0
rtl/openbsd/rtldefs.inc

@@ -0,0 +1,18 @@
+{
+    This file is part of the Free Pascal run time library.
+    Copyright (c) 2012 by Free Pascal development team
+
+    This file contains platform-specific defines that are used in
+    multiple RTL units.
+
+    See the file COPYING.FPC, included in this distribution,
+    for details about the copyright.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+ **********************************************************************}
+
+{ the single byte OS APIs always use UTF-8 }
+{ define FPCRTL_FILESYSTEM_UTF8}

+ 18 - 0
rtl/os2/rtldefs.inc

@@ -0,0 +1,18 @@
+{
+    This file is part of the Free Pascal run time library.
+    Copyright (c) 2012 by Free Pascal development team
+
+    This file contains platform-specific defines that are used in
+    multiple RTL units.
+
+    See the file COPYING.FPC, included in this distribution,
+    for details about the copyright.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+ **********************************************************************}
+
+{ the single byte OS APIs always use UTF-8 }
+{ define FPCRTL_FILESYSTEM_UTF8}

+ 18 - 0
rtl/palmos/rtldefs.inc

@@ -0,0 +1,18 @@
+{
+    This file is part of the Free Pascal run time library.
+    Copyright (c) 2012 by Free Pascal development team
+
+    This file contains platform-specific defines that are used in
+    multiple RTL units.
+
+    See the file COPYING.FPC, included in this distribution,
+    for details about the copyright.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+ **********************************************************************}
+
+{ the single byte OS APIs always use UTF-8 }
+{ define FPCRTL_FILESYSTEM_UTF8}

+ 18 - 0
rtl/qnx/rtldefs.inc

@@ -0,0 +1,18 @@
+{
+    This file is part of the Free Pascal run time library.
+    Copyright (c) 2012 by Free Pascal development team
+
+    This file contains platform-specific defines that are used in
+    multiple RTL units.
+
+    See the file COPYING.FPC, included in this distribution,
+    for details about the copyright.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+ **********************************************************************}
+
+{ the single byte OS APIs always use UTF-8 }
+{ define FPCRTL_FILESYSTEM_UTF8}

+ 18 - 0
rtl/solaris/rtldefs.inc

@@ -0,0 +1,18 @@
+{
+    This file is part of the Free Pascal run time library.
+    Copyright (c) 2012 by Free Pascal development team
+
+    This file contains platform-specific defines that are used in
+    multiple RTL units.
+
+    See the file COPYING.FPC, included in this distribution,
+    for details about the copyright.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+ **********************************************************************}
+
+{ the single byte OS APIs always use UTF-8 }
+{ define FPCRTL_FILESYSTEM_UTF8}

+ 18 - 0
rtl/symbian/rtldefs.inc

@@ -0,0 +1,18 @@
+{
+    This file is part of the Free Pascal run time library.
+    Copyright (c) 2012 by Free Pascal development team
+
+    This file contains platform-specific defines that are used in
+    multiple RTL units.
+
+    See the file COPYING.FPC, included in this distribution,
+    for details about the copyright.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+ **********************************************************************}
+
+{ the single byte OS APIs always use UTF-8 }
+{ define FPCRTL_FILESYSTEM_UTF8}

+ 9 - 1
rtl/unix/cwstring.pp

@@ -989,6 +989,13 @@ function GetStandardCodePage(const stdcp: TStandardCodePageEnum): TSystemCodePag
 var
   langinfo: pchar;
 begin
+  {$ifdef FPCRTL_FILESYSTEM_UTF8}
+  if stdcp=scpFileSystemSingleByte then
+    begin
+       result:=CP_UTF8;
+       exit;
+    end;
++{$endif}
   langinfo:=nl_langinfo(CODESET);
   { there's a bug in the Mac OS X 10.5 libc (based on FreeBSD's)
     that causes it to return an empty string of UTF-8 locales
@@ -1082,7 +1089,8 @@ initialization
 
   { set the DefaultSystemCodePage }
   DefaultSystemCodePage:=GetStandardCodePage(scpAnsi);
-
+  DefaultFileSystemCodePage:=GetStandardCodePage(scpFileSystemSingleByte);
+  DefaultRTLFileSystemCodePage:=DefaultFileSystemCodePage;
   {$ifdef FPC_HAS_CPSTRING}
   SetStdIOCodePages;
   {$endif FPC_HAS_CPSTRING}

+ 18 - 0
rtl/watcom/rtldefs.inc

@@ -0,0 +1,18 @@
+{
+    This file is part of the Free Pascal run time library.
+    Copyright (c) 2012 by Free Pascal development team
+
+    This file contains platform-specific defines that are used in
+    multiple RTL units.
+
+    See the file COPYING.FPC, included in this distribution,
+    for details about the copyright.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+ **********************************************************************}
+
+{ the single byte OS APIs always use UTF-8 }
+{ define FPCRTL_FILESYSTEM_UTF8}

+ 18 - 0
rtl/wii/rtldefs.inc

@@ -0,0 +1,18 @@
+{
+    This file is part of the Free Pascal run time library.
+    Copyright (c) 2012 by Free Pascal development team
+
+    This file contains platform-specific defines that are used in
+    multiple RTL units.
+
+    See the file COPYING.FPC, included in this distribution,
+    for details about the copyright.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+ **********************************************************************}
+
+{ the single byte OS APIs always use UTF-8 }
+{ define FPCRTL_FILESYSTEM_UTF8}

+ 4 - 1
rtl/win/syswin.inc

@@ -568,7 +568,8 @@ function GetConsoleCP:UINT; stdcall; external 'kernel32' name 'GetConsoleCP';
 function Win32GetStandardCodePage(const stdcp: TStandardCodePageEnum): TSystemCodePage;
   begin
     case stdcp of
-      scpAnsi: Result := GetACP;
+      scpAnsi,
+      scpFileSystemSingleByte: Result := GetACP;
       scpConsoleInput: Result := GetConsoleCP;
       scpConsoleOutput: Result := GetConsoleOutputCP;
     end;
@@ -612,5 +613,7 @@ procedure InitWin32Widestrings;
 
     DefaultSystemCodePage:=GetACP;
     DefaultUnicodeCodePage:=CP_UTF16;
+    DefaultFileSystemCodePage:=DefaultSystemCodePage;
+    DefaultRTLFileSystemCodePage:=DefaultFileSystemCodePage;
   end;
 

+ 18 - 0
rtl/win32/rtldefs.inc

@@ -0,0 +1,18 @@
+{
+    This file is part of the Free Pascal run time library.
+    Copyright (c) 2012 by Free Pascal development team
+
+    This file contains platform-specific defines that are used in
+    multiple RTL units.
+
+    See the file COPYING.FPC, included in this distribution,
+    for details about the copyright.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+ **********************************************************************}
+
+{ the single byte OS APIs always use UTF-8 }
+{ define FPCRTL_FILESYSTEM_UTF8}

+ 18 - 0
rtl/win64/rtldefs.inc

@@ -0,0 +1,18 @@
+{
+    This file is part of the Free Pascal run time library.
+    Copyright (c) 2012 by Free Pascal development team
+
+    This file contains platform-specific defines that are used in
+    multiple RTL units.
+
+    See the file COPYING.FPC, included in this distribution,
+    for details about the copyright.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+ **********************************************************************}
+
+{ the single byte OS APIs always use UTF-8 }
+{ define FPCRTL_FILESYSTEM_UTF8}

+ 18 - 0
rtl/wince/rtldefs.inc

@@ -0,0 +1,18 @@
+{
+    This file is part of the Free Pascal run time library.
+    Copyright (c) 2012 by Free Pascal development team
+
+    This file contains platform-specific defines that are used in
+    multiple RTL units.
+
+    See the file COPYING.FPC, included in this distribution,
+    for details about the copyright.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+ **********************************************************************}
+
+{ the single byte OS APIs always use UTF-8 }
+{ define FPCRTL_FILESYSTEM_UTF8}

+ 5 - 0
rtl/wince/system.pp

@@ -1591,6 +1591,9 @@ function WinCEGetStandardCodePage(const stdcp: TStandardCodePageEnum): TSystemCo
       scpAnsi: Result := GetACP;
       scpConsoleInput: Result := GetACP;
       scpConsoleOutput: Result := GetACP;
+      { WinCE only has two byte APIs. Set single byte encoding to UTF8 to prevent unnecessary
+        mangling. }
+      scpFileSystemSingleByte: Result := CP_UTF8;
     end;
   end;
 
@@ -1612,6 +1615,8 @@ procedure InitWinCEWidestrings;
 
     DefaultSystemCodePage:=GetACP;
     DefaultUnicodeCodePage:=CP_UTF16;
+    DefaultFileSystemCodePage:=DefaultSystemCodePage;
+    DefaultRTLFileSystemCodePage:=DefaultFileSystemCodePage;
   end;