From 3a6d9e912f592d8cbedca5c866576b8ca8f33342 Mon Sep 17 00:00:00 2001 From: Daniel Ehrenberg <littledan@Macintosh-122.local> Date: Mon, 2 Mar 2009 23:31:13 -0600 Subject: [PATCH] Minor bug fixes --- basis/io/encodings/euc/euc.factor | 12 +++++++----- basis/io/encodings/johab/johab-docs.factor | 2 +- basis/io/encodings/johab/johab-tests.factor | 4 +++- basis/io/encodings/shift-jis/shift-jis.factor | 4 ++-- 4 files changed, 13 insertions(+), 9 deletions(-) diff --git a/basis/io/encodings/euc/euc.factor b/basis/io/encodings/euc/euc.factor index 25c6e207e9..e20580876e 100644 --- a/basis/io/encodings/euc/euc.factor +++ b/basis/io/encodings/euc/euc.factor @@ -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? ; diff --git a/basis/io/encodings/johab/johab-docs.factor b/basis/io/encodings/johab/johab-docs.factor index 010baefeef..1d707e0f7d 100644 --- a/basis/io/encodings/johab/johab-docs.factor +++ b/basis/io/encodings/johab/johab-docs.factor @@ -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 diff --git a/basis/io/encodings/johab/johab-tests.factor b/basis/io/encodings/johab/johab-tests.factor index cf9e13d438..2c7ff96e21 100644 --- a/basis/io/encodings/johab/johab-tests.factor +++ b/basis/io/encodings/johab/johab-tests.factor @@ -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{ diff --git a/basis/io/encodings/shift-jis/shift-jis.factor b/basis/io/encodings/shift-jis/shift-jis.factor index 7971f30332..99cfa26d12 100644 --- a/basis/io/encodings/shift-jis/shift-jis.factor +++ b/basis/io/encodings/shift-jis/shift-jis.factor @@ -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 -- ? )