Minor bug fixes

db4
Daniel Ehrenberg 2009-03-02 23:31:13 -06:00
parent 8c61791364
commit 3a6d9e912f
4 changed files with 13 additions and 9 deletions

View File

@ -13,11 +13,13 @@ TUPLE: euc { table biassoc } ;
HEX: 0 HEX: ff between? ; HEX: 0 HEX: ff between? ;
M: euc encode-char ( char stream encoding -- ) M: euc encode-char ( char stream encoding -- )
swapd table>> value-at dup byte? swapd table>> value-at [
[ swap stream-write1 ] [ dup byte?
h>b/b swap 2byte-array [ swap stream-write1 ] [
swap stream-write h>b/b swap 2byte-array
] if ; swap stream-write
] if
] [ encode-error ] if* ;
: euc-multibyte? ( ch -- ? ) : euc-multibyte? ( ch -- ? )
HEX: 81 HEX: fe between? ; HEX: 81 HEX: fe between? ;

View File

@ -1,7 +1,7 @@
! Copyright (C) 2009 Yun, Jonghyouk. ! Copyright (C) 2009 Yun, Jonghyouk.
! See http://factorcode.org/license.txt for BSD license. ! See http://factorcode.org/license.txt for BSD license.
USING: help.syntax help.markup ; USING: help.syntax help.markup ;
IN: io.encodings.korean.johab IN: io.encodings.johab
ABOUT: johab ABOUT: johab

View File

@ -1,6 +1,6 @@
! Copyright (C) 2009 Yun, Jonghyouk. ! Copyright (C) 2009 Yun, Jonghyouk.
! See http://factorcode.org/license.txt for BSD license. ! See http://factorcode.org/license.txt for BSD license.
USING: arrays byte-arrays io io.encodings io.encodings.euc-kr assocs USING: arrays byte-arrays io io.encodings io.encodings.johab assocs
io.encodings.string io.streams.string io.encodings.euc.private words io.encodings.string io.streams.string io.encodings.euc.private words
kernel locals multiline namespaces sequences strings tools.test ; kernel locals multiline namespaces sequences strings tools.test ;
IN: io.encodings.johab.tests IN: io.encodings.johab.tests
@ -16,6 +16,8 @@ IN: io.encodings.johab.tests
[ HEX: 3133 ] [ HEX: 8444 johab>unicode ] unit-test [ HEX: 3133 ] [ HEX: 8444 johab>unicode ] unit-test
[ HEX: 8A5D ] [ HEX: AD4F unicode>johab ] unit-test [ HEX: 8A5D ] [ HEX: AD4F unicode>johab ] unit-test
: phrase-unicode ( -- s )
"\u00b3d9\u00d574\u00bb3c\u00acfc \u00bc31\u00b450\u00c0b0\u00c774!" ;
: phrase-johab ( -- s ) : phrase-johab ( -- s )
B{ B{

View File

@ -35,10 +35,10 @@ TUPLE: jis assoc ;
: make-jis ( filename -- jis ) : make-jis ( filename -- jis )
flat-file>biassoc [ nip ] assoc-filter jis boa ; flat-file>biassoc [ nip ] assoc-filter jis boa ;
"vocab:io/encodings/japanese/CP932.txt" "vocab:io/encodings/shift-jis/CP932.txt"
make-jis to: windows-31j-table make-jis to: windows-31j-table
"vocab:io/encodings/japanese/sjis-0208-1997-std.txt" "vocab:io/encodings/shift-jis/sjis-0208-1997-std.txt"
make-jis to: shift-jis-table make-jis to: shift-jis-table
: small? ( char -- ? ) : small? ( char -- ? )