Revert Windows console encoding since the DOS prompt is not really cp1252

db4
Slava Pestov 2009-01-27 04:29:44 -06:00
parent 730246c5e9
commit ad7b4cec01
2 changed files with 6 additions and 12 deletions

View File

@ -1,7 +1,7 @@
! Copyright (C) 2004, 2008 Mackenzie Straight, Doug Coleman. ! Copyright (C) 2004, 2008 Mackenzie Straight, Doug Coleman.
! See http://factorcode.org/license.txt for BSD license. ! See http://factorcode.org/license.txt for BSD license.
USING: alien alien.c-types arrays destructors io io.backend io.buffers USING: alien alien.c-types arrays destructors io io.backend
io.files io.ports io.binary io.timeouts io.encodings.8-bit io.buffers io.files io.ports io.binary io.timeouts
windows.errors strings kernel math namespaces sequences windows windows.errors strings kernel math namespaces sequences windows
windows.kernel32 windows.shell32 windows.types windows.winsock windows.kernel32 windows.shell32 windows.types windows.winsock
splitting continuations math.bitwise system accessors ; splitting continuations math.bitwise system accessors ;
@ -51,6 +51,4 @@ HOOK: add-completion io-backend ( port -- )
: default-security-attributes ( -- obj ) : default-security-attributes ( -- obj )
"SECURITY_ATTRIBUTES" <c-object> "SECURITY_ATTRIBUTES" <c-object>
"SECURITY_ATTRIBUTES" heap-size "SECURITY_ATTRIBUTES" heap-size
over set-SECURITY_ATTRIBUTES-nLength ; over set-SECURITY_ATTRIBUTES-nLength ;
M: windows console-encoding windows-1252 ;

View File

@ -14,15 +14,11 @@ HOOK: init-io io-backend ( -- )
HOOK: (init-stdio) io-backend ( -- stdin stdout stderr ) HOOK: (init-stdio) io-backend ( -- stdin stdout stderr )
HOOK: console-encoding os ( -- encoding )
M: object console-encoding utf8 ;
: init-stdio ( -- ) : init-stdio ( -- )
(init-stdio) (init-stdio)
[ console-encoding <decoder> input-stream set-global ] [ utf8 <decoder> input-stream set-global ]
[ console-encoding <encoder> output-stream set-global ] [ utf8 <encoder> output-stream set-global ]
[ console-encoding <encoder> error-stream set-global ] tri* ; [ utf8 <encoder> error-stream set-global ] tri* ;
HOOK: io-multiplex io-backend ( us -- ) HOOK: io-multiplex io-backend ( us -- )