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? ;
M: euc encode-char ( char stream encoding -- )
swapd table>> value-at dup byte?
[ swap stream-write1 ] [
h>b/b swap 2byte-array
swap stream-write
] if ;
swapd table>> value-at [
dup byte?
[ swap stream-write1 ] [
h>b/b swap 2byte-array
swap stream-write
] if
] [ encode-error ] if* ;
: euc-multibyte? ( ch -- ? )
HEX: 81 HEX: fe between? ;

View File

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

View File

@ -1,6 +1,6 @@
! Copyright (C) 2009 Yun, Jonghyouk.
! 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
kernel locals multiline namespaces sequences strings tools.test ;
IN: io.encodings.johab.tests
@ -16,6 +16,8 @@ IN: io.encodings.johab.tests
[ HEX: 3133 ] [ HEX: 8444 johab>unicode ] unit-test
[ HEX: 8A5D ] [ HEX: AD4F unicode>johab ] unit-test
: phrase-unicode ( -- s )
"\u00b3d9\u00d574\u00bb3c\u00acfc \u00bc31\u00b450\u00c0b0\u00c774!" ;
: phrase-johab ( -- s )
B{

View File

@ -35,10 +35,10 @@ TUPLE: jis assoc ;
: make-jis ( filename -- jis )
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
"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
: small? ( char -- ? )