]> gitweb.factorcode.org Git - factor.git/commitdiff
Use windows-1252 encoding for stdin/stdout on Windows
authorSlava Pestov <slava@slava-pestovs-macbook-pro.local>
Tue, 27 Jan 2009 06:03:34 +0000 (00:03 -0600)
committerSlava Pestov <slava@slava-pestovs-macbook-pro.local>
Tue, 27 Jan 2009 06:03:34 +0000 (00:03 -0600)
basis/io/backend/windows/windows.factor
core/io/backend/backend.factor

index e7c72edfd06d606d2c9a9fa6c96e7af20cf8d568..bf01f1d621dca16b014520d3ac66191255931c78 100755 (executable)
@@ -1,7 +1,7 @@
 ! Copyright (C) 2004, 2008 Mackenzie Straight, Doug Coleman.
 ! See http://factorcode.org/license.txt for BSD license.
-USING: alien alien.c-types arrays destructors io io.backend
-io.buffers io.files io.ports io.binary io.timeouts
+USING: alien alien.c-types arrays destructors io io.backend io.buffers
+io.files io.ports io.binary io.timeouts io.encodings.8-bit
 windows.errors strings kernel math namespaces sequences windows
 windows.kernel32 windows.shell32 windows.types windows.winsock
 splitting continuations math.bitwise system accessors ;
@@ -52,3 +52,5 @@ HOOK: add-completion io-backend ( port -- )
     "SECURITY_ATTRIBUTES" <c-object>
     "SECURITY_ATTRIBUTES" heap-size
     over set-SECURITY_ATTRIBUTES-nLength ;
+
+M: windows console-encoding windows-1252 ;
\ No newline at end of file
index e2c6c3d4647709e3a96eb791ae2f304c214af8e4..dc22c7a9755e0d0de3493d8340413e8101849a95 100644 (file)
@@ -1,4 +1,4 @@
-! Copyright (C) 2007, 2008 Slava Pestov.
+! Copyright (C) 2007, 2009 Slava Pestov.
 ! See http://factorcode.org/license.txt for BSD license.
 USING: init kernel system namespaces io io.encodings
 io.encodings.utf8 init assocs splitting alien ;
@@ -14,11 +14,15 @@ HOOK: init-io io-backend ( -- )
 
 HOOK: (init-stdio) io-backend ( -- stdin stdout stderr )
 
+HOOK: console-encoding os ( -- encoding )
+
+M: object console-encoding utf8 ;
+
 : init-stdio ( -- )
     (init-stdio)
-    [ utf8 <decoder> input-stream set-global ]
-    [ utf8 <encoder> output-stream set-global ]
-    [ utf8 <encoder> error-stream set-global ] tri* ;
+    [ console-encoding <decoder> input-stream set-global ]
+    [ console-encoding <encoder> output-stream set-global ]
+    [ console-encoding <encoder> error-stream set-global ] tri* ;
 
 HOOK: io-multiplex io-backend ( us -- )