checkin from browser
authorClaus Gittinger <cg@exept.de>
Fri, 04 Jul 1997 11:23:39 +0200
changeset 2748 3002ca130a92
parent 2747 0a95a87bcefa
child 2749 62552ae3b004
checkin from browser
CharArray.st
CharacterArray.st
--- a/CharArray.st	Fri Jul 04 10:45:06 1997 +0200
+++ b/CharArray.st	Fri Jul 04 11:23:39 1997 +0200
@@ -755,8 +755,9 @@
 decodeFromBIG5_or_GB:aString into:a16BitString
     "return a new string containing the characters from aString,
      which is interpreted as a BIG5 encoded singleByte string.
-
-     The result is a Big5EncodedString (you need a BIG5 font to display that ...)."
+     The result is a Big5EncodedString (you need a BIG5 font to display that ...).
+
+     This is a first-class candidate for a primitive"
 
     |sz     "{ Class: SmallInteger }"
      dstIdx "{ Class: SmallInteger }"
@@ -800,7 +801,7 @@
     ^ a16BitString
 
     "Created: 17.4.1996 / 16:55:54 / cg"
-    "Modified: 30.6.1997 / 15:44:52 / cg"
+    "Modified: 4.7.1997 / 11:01:38 / cg"
 !
 
 decodeFromEUC:aString
@@ -809,7 +810,9 @@
 
      There are various JIS encodings around (New-JIS, Old-JIS and NEC-JIS);
      this one only understands New-JIS.
-     The result is a JISEncodedString (you need a JIS font to display that ...)."
+     The result is a JISEncodedString (you need a JIS font to display that ...).
+
+     This is a first-class candidate for a primitive"
 
     |newString 
      sz     "{ Class: SmallInteger }"
@@ -829,38 +832,32 @@
         [true] whileTrue:[
             c := aString at:start.
             b1 := c asciiValue.
-            b1 < 33 ifTrue:[
+            b1 < 161 ifTrue:[
+                "/ characters below 16rA1 are left untranslated
+                "/ (control character or roman).
                 newString at:dstIdx put:c.
-                dstIdx := dstIdx + 1.
             ] ifFalse:[
-                b1 < 161 ifTrue:[
-                    "/ characters below 16rA1 are left untranslated
-                    "/ (romans).
-                    newString at:dstIdx put:c.
-                    dstIdx := dstIdx + 1.
+                start := start + 1.
+                start <= sz ifTrue:[    
+                    b1 := b1 - 128.
+                    b2 := (c2 := aString at:start) asciiValue.
+                    b2 := b2 - 128.
+                    val := (b1 bitShift:8) bitOr:b2.
+                    val <= 0 ifTrue:[
+                        DecodingFailedSignal 
+                            raiseWith:aString
+                            errorString:'EUC decoding failed (not EUC encoded ?)'.
+                        newString at:dstIdx put:c.
+                        dstIdx := dstIdx + 1.
+                        newString at:dstIdx put:c2.
+                    ] ifFalse:[
+                        newString at:dstIdx put:(Character value:val).
+                    ].
                 ] ifFalse:[
-                    start := start + 1.
-                    start <= sz ifTrue:[    
-                        b1 := b1 - 128.
-                        b2 := (c2 := aString at:start) asciiValue.
-                        b2 := b2 - 128.
-                        val := (b1 bitShift:8) bitOr:b2.
-                        val <= 0 ifTrue:[
-                            DecodingFailedSignal 
-                                raiseWith:aString
-                                errorString:'EUC decoding failed (not EUC encoded ?)'.
-                            newString at:dstIdx put:c.
-                            dstIdx := dstIdx + 1.
-                            newString at:dstIdx put:c2.
-                        ] ifFalse:[
-                            newString at:dstIdx put:(Character value:val).
-                        ].
-                    ] ifFalse:[
-                        newString at:dstIdx put:c.
-                    ].
-                    dstIdx := dstIdx + 1.
-                ]
+                    newString at:dstIdx put:c.
+                ].
             ].
+            dstIdx := dstIdx + 1.
             start := start + 1.
 
             start > sz ifTrue:[
@@ -876,7 +873,7 @@
     "
 
     "Created: 17.4.1996 / 16:10:22 / cg"
-    "Modified: 30.6.1997 / 18:25:05 / cg"
+    "Modified: 4.7.1997 / 11:06:05 / cg"
 !
 
 decodeFromGB:aString
@@ -898,7 +895,9 @@
      which are interpreted as a JIS7 encoded singleByte string.
      There are various JIS encodings around (New-JIS, Old-JIS and NEC-JIS);
      this one understands New-JIS and treats Old-JIS just the same.
-     The result is a JISEncodedString (you need a JIS font to display that ...)."
+     The result is a JISEncodedString (you need a JIS font to display that ...).
+
+     This is a first-class candidate for a primitive"
 
     |newString 
      sz         "{ Class: SmallInteger }"
@@ -1105,13 +1104,15 @@
     "
 
     "Created: 17.4.1996 / 16:11:57 / cg"
-    "Modified: 30.6.1997 / 20:53:46 / cg"
+    "Modified: 4.7.1997 / 11:01:48 / cg"
 !
 
 decodeFromSJIS:aString
     "return a new string containing the aStrings characters,
      which are interpreted as a Shift-JIS encoded singleByte string.
-     The result is a JISEncodedString (you need a JIS font to display that ...)."
+     The result is a JISEncodedString (you need a JIS font to display that ...).
+
+     This is a first-class candidate for a primitive"
 
     |newString char1 char2
      sz         "{ Class: SmallInteger }"
@@ -1199,7 +1200,7 @@
     "
 
     "Created: 28.6.1997 / 19:19:23 / cg"
-    "Modified: 2.7.1997 / 12:08:20 / cg"
+    "Modified: 4.7.1997 / 11:01:22 / cg"
 !
 
 encodeIntoBIG5:aBIG5String
@@ -1208,7 +1209,9 @@
      This is used translate 16bit BIG5 strings into the external BIG5 encoded
      representation.
      The resulting string is only useful to be stored on some external file,
-     not for being displayed in an ST/X view."
+     not for being displayed in an ST/X view.
+
+     This is a first-class candidate for a primitive"
 
     |sz "{ Class: SmallInteger }"
      b  "{ Class: SmallInteger }"
@@ -1236,15 +1239,16 @@
     ^ out contents
 
     "Created: 17.4.1996 / 17:17:50 / cg"
-    "Modified: 30.6.1997 / 15:57:42 / cg"
+    "Modified: 4.7.1997 / 11:01:57 / cg"
 !
 
 encodeIntoEUC:aJISString
     "return a new string with aJISStrings characters as EUC encoded 8bit string.
      The argument must be a JIS 16 bit character string.
-
      The resulting string is only useful to be stored on some external file,
-     not for being displayed in an ST/X view."
+     not for being displayed in an ST/X view.
+
+     This is a first-class candidate for a primitive"
 
     |sz "{ Class: SmallInteger }"
      b1 "{ Class: SmallInteger }"
@@ -1260,29 +1264,25 @@
 
     1 to:sz do:[:srcIndex |
         b1 := (c := aJISString at:srcIndex) asciiValue.
-        b1 < 33 ifTrue:[
-            "/ a control character    
+        b1 < 161 ifTrue:[
+            "/ a control or roman character    
             out nextPut:c.
         ] ifFalse:[
-            b1 < 161 ifTrue:[
-                "/ a roman character    
-                out nextPut:c.
-            ] ifFalse:[
-                "/ check for a roman character
-                "/ the two numbers below are romanTable min and romanTable max
-                "/
-                (b1 between:16r2121 and:16r2573) ifTrue:[
-                    val := romans indexOf:b1.
-                    (val ~~ 0 and:[val <= 127]) ifTrue:[
-                        out nextPut:(Character value:(val - 1 + 32))
-                    ] ifFalse:[
-                        out nextPut:(Character value:(b1 bitShift:-8) + 128).
-                        out nextPut:(Character value:(b1 bitAnd:16rFF) + 128).
-                    ].
+            "/
+            "/ check for a roman character
+            "/ the two numbers below are romanTable min and romanTable max
+            "/
+            (b1 between:16r2121 and:16r2573) ifTrue:[
+                val := romans indexOf:b1.
+                (val ~~ 0 and:[val <= 127]) ifTrue:[
+                    out nextPut:(Character value:(val - 1 + 32))
                 ] ifFalse:[
                     out nextPut:(Character value:(b1 bitShift:-8) + 128).
                     out nextPut:(Character value:(b1 bitAnd:16rFF) + 128).
-                ]
+                ].
+            ] ifFalse:[
+                out nextPut:(Character value:(b1 bitShift:-8) + 128).
+                out nextPut:(Character value:(b1 bitAnd:16rFF) + 128).
             ]
         ].
     ].
@@ -1294,7 +1294,7 @@
     "
 
     "Created: 17.4.1996 / 16:13:33 / cg"
-    "Modified: 4.7.1997 / 10:42:25 / cg"
+    "Modified: 4.7.1997 / 11:03:43 / cg"
 !
 
 encodeIntoGB:aGBString
@@ -1303,7 +1303,9 @@
      This is used translate 16bit GB strings into the external GB encoded
      representation.
      The resulting string is only useful to be stored on some external file,
-     not for being displayed in an ST/X view."
+     not for being displayed in an ST/X view.
+
+     This is a first-class candidate for a primitive"
 
     |sz "{ Class: SmallInteger }"
      b  "{ Class: SmallInteger }"
@@ -1330,7 +1332,7 @@
     ^ out contents
 
     "Created: 30.6.1997 / 15:48:35 / cg"
-    "Modified: 30.6.1997 / 15:57:49 / cg"
+    "Modified: 4.7.1997 / 11:02:13 / cg"
 !
 
 encodeIntoJIS7:aJISString
@@ -1446,63 +1448,58 @@
 
     1 to:sz do:[:srcIndex |
         val := (c := aJISString at:srcIndex) asciiValue.
-        val < 33 ifTrue:[
-            "/ a control character    
+        val <= 128 ifTrue:[
+            "/ a control or ascii character    
             out nextPut:c.
         ] ifFalse:[
-            val <= 128 ifTrue:[
+            (val > 150 and:[val < 224]) ifTrue:[
                 "/ ascii subset
                 out nextPut:c.
             ] ifFalse:[
-                (val > 150 and:[val < 224]) ifTrue:[
-                    "/ ascii subset
+                "/ should not happen ...
+                val <= 255 ifTrue:[
                     out nextPut:c.
                 ] ifFalse:[
-                    "/ should not happen ...
-                    val <= 255 ifTrue:[
-                        out nextPut:c.
-                    ] ifFalse:[
-                        isSJIS := true.
-
-                        "/ check for HALFWIDTH KATAKANA
-                        "/ 8E:xx
-
-                        (val bitAnd:16rFF00) == 16r8E00 ifTrue:[
-                            |b|
-
-                            b := (val bitAnd:16rFF) + 128.
-                            (b >= 16rA1 "161" and:[b <= 16rDF "223"]) ifTrue:[
-                                out nextPut:(Character value:b).
+                    isSJIS := true.
+
+                    "/ check for HALFWIDTH KATAKANA
+                    "/ 8E:xx
+
+                    (val bitAnd:16rFF00) == 16r8E00 ifTrue:[
+                        |b|
+
+                        b := (val bitAnd:16rFF) + 128.
+                        (b >= 16rA1 "161" and:[b <= 16rDF "223"]) ifTrue:[
+                            out nextPut:(Character value:b).
+                            isSJIS := false.
+                        ].
+                    ].
+
+                    isSJIS ifTrue:[
+
+                        "/ check for a roman character
+                        "/ the two numbers below are romanTable min and romanTable max
+                        "/
+                        (val between:16r2121 and:16r2573) ifTrue:[
+                            rval := romans indexOf:val.
+                            rval ~~ 0 ifTrue:[
+                                out nextPut:(Character value:(rval - 1 + 32)).
                                 isSJIS := false.
                             ].
                         ].
-
-                        isSJIS ifTrue:[
-
-                            "/ check for a roman character
-                            "/ the two numbers below are romanTable min and romanTable max
-                            "/
-                            (val between:16r2121 and:16r2573) ifTrue:[
-                                rval := romans indexOf:val.
-                                rval ~~ 0 ifTrue:[
-                                    out nextPut:(Character value:(rval - 1 + 32)).
-                                    isSJIS := false.
-                                ].
-                            ].
-                        ].
-
-                        isSJIS ifTrue:[
-                            |b1 b2 rowOffset cellOffset|
-
-                            b1 := (val bitShift:-8).
-                            b2 := (val bitAnd:16rFF).
-                            rowOffset := (b1 < 95) ifTrue:[112] ifFalse:[176].
-                            cellOffset := b1 odd ifTrue:[(b2 > 95) ifTrue:[32] ifFalse:[31]]
-                                                 ifFalse:[126].
-
-                            out nextPut:(Character value:(((b1 + 1) bitShift:-1) + rowOffset)).
-                            out nextPut:(Character value:b2 + cellOffset).
-                        ]
+                    ].
+
+                    isSJIS ifTrue:[
+                        |b1 b2 rowOffset cellOffset|
+
+                        b1 := (val bitShift:-8).
+                        b2 := (val bitAnd:16rFF).
+                        rowOffset := (b1 < 95) ifTrue:[112] ifFalse:[176].
+                        cellOffset := b1 odd ifTrue:[(b2 > 95) ifTrue:[32] ifFalse:[31]]
+                                             ifFalse:[126].
+
+                        out nextPut:(Character value:(((b1 + 1) bitShift:-1) + rowOffset)).
+                        out nextPut:(Character value:b2 + cellOffset).
                     ]
                 ]
             ]
@@ -1516,7 +1513,7 @@
     "
 
     "Created: 28.6.1997 / 21:13:27 / cg"
-    "Modified: 2.7.1997 / 12:07:56 / cg"
+    "Modified: 4.7.1997 / 11:04:32 / cg"
 !
 
 encodeRomans:aTwoByteString
@@ -4838,6 +4835,6 @@
 !CharacterArray class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/Attic/CharArray.st,v 1.125 1997-07-04 08:45:06 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/Attic/CharArray.st,v 1.126 1997-07-04 09:23:39 cg Exp $'
 ! !
 CharacterArray initialize!
--- a/CharacterArray.st	Fri Jul 04 10:45:06 1997 +0200
+++ b/CharacterArray.st	Fri Jul 04 11:23:39 1997 +0200
@@ -755,8 +755,9 @@
 decodeFromBIG5_or_GB:aString into:a16BitString
     "return a new string containing the characters from aString,
      which is interpreted as a BIG5 encoded singleByte string.
-
-     The result is a Big5EncodedString (you need a BIG5 font to display that ...)."
+     The result is a Big5EncodedString (you need a BIG5 font to display that ...).
+
+     This is a first-class candidate for a primitive"
 
     |sz     "{ Class: SmallInteger }"
      dstIdx "{ Class: SmallInteger }"
@@ -800,7 +801,7 @@
     ^ a16BitString
 
     "Created: 17.4.1996 / 16:55:54 / cg"
-    "Modified: 30.6.1997 / 15:44:52 / cg"
+    "Modified: 4.7.1997 / 11:01:38 / cg"
 !
 
 decodeFromEUC:aString
@@ -809,7 +810,9 @@
 
      There are various JIS encodings around (New-JIS, Old-JIS and NEC-JIS);
      this one only understands New-JIS.
-     The result is a JISEncodedString (you need a JIS font to display that ...)."
+     The result is a JISEncodedString (you need a JIS font to display that ...).
+
+     This is a first-class candidate for a primitive"
 
     |newString 
      sz     "{ Class: SmallInteger }"
@@ -829,38 +832,32 @@
         [true] whileTrue:[
             c := aString at:start.
             b1 := c asciiValue.
-            b1 < 33 ifTrue:[
+            b1 < 161 ifTrue:[
+                "/ characters below 16rA1 are left untranslated
+                "/ (control character or roman).
                 newString at:dstIdx put:c.
-                dstIdx := dstIdx + 1.
             ] ifFalse:[
-                b1 < 161 ifTrue:[
-                    "/ characters below 16rA1 are left untranslated
-                    "/ (romans).
-                    newString at:dstIdx put:c.
-                    dstIdx := dstIdx + 1.
+                start := start + 1.
+                start <= sz ifTrue:[    
+                    b1 := b1 - 128.
+                    b2 := (c2 := aString at:start) asciiValue.
+                    b2 := b2 - 128.
+                    val := (b1 bitShift:8) bitOr:b2.
+                    val <= 0 ifTrue:[
+                        DecodingFailedSignal 
+                            raiseWith:aString
+                            errorString:'EUC decoding failed (not EUC encoded ?)'.
+                        newString at:dstIdx put:c.
+                        dstIdx := dstIdx + 1.
+                        newString at:dstIdx put:c2.
+                    ] ifFalse:[
+                        newString at:dstIdx put:(Character value:val).
+                    ].
                 ] ifFalse:[
-                    start := start + 1.
-                    start <= sz ifTrue:[    
-                        b1 := b1 - 128.
-                        b2 := (c2 := aString at:start) asciiValue.
-                        b2 := b2 - 128.
-                        val := (b1 bitShift:8) bitOr:b2.
-                        val <= 0 ifTrue:[
-                            DecodingFailedSignal 
-                                raiseWith:aString
-                                errorString:'EUC decoding failed (not EUC encoded ?)'.
-                            newString at:dstIdx put:c.
-                            dstIdx := dstIdx + 1.
-                            newString at:dstIdx put:c2.
-                        ] ifFalse:[
-                            newString at:dstIdx put:(Character value:val).
-                        ].
-                    ] ifFalse:[
-                        newString at:dstIdx put:c.
-                    ].
-                    dstIdx := dstIdx + 1.
-                ]
+                    newString at:dstIdx put:c.
+                ].
             ].
+            dstIdx := dstIdx + 1.
             start := start + 1.
 
             start > sz ifTrue:[
@@ -876,7 +873,7 @@
     "
 
     "Created: 17.4.1996 / 16:10:22 / cg"
-    "Modified: 30.6.1997 / 18:25:05 / cg"
+    "Modified: 4.7.1997 / 11:06:05 / cg"
 !
 
 decodeFromGB:aString
@@ -898,7 +895,9 @@
      which are interpreted as a JIS7 encoded singleByte string.
      There are various JIS encodings around (New-JIS, Old-JIS and NEC-JIS);
      this one understands New-JIS and treats Old-JIS just the same.
-     The result is a JISEncodedString (you need a JIS font to display that ...)."
+     The result is a JISEncodedString (you need a JIS font to display that ...).
+
+     This is a first-class candidate for a primitive"
 
     |newString 
      sz         "{ Class: SmallInteger }"
@@ -1105,13 +1104,15 @@
     "
 
     "Created: 17.4.1996 / 16:11:57 / cg"
-    "Modified: 30.6.1997 / 20:53:46 / cg"
+    "Modified: 4.7.1997 / 11:01:48 / cg"
 !
 
 decodeFromSJIS:aString
     "return a new string containing the aStrings characters,
      which are interpreted as a Shift-JIS encoded singleByte string.
-     The result is a JISEncodedString (you need a JIS font to display that ...)."
+     The result is a JISEncodedString (you need a JIS font to display that ...).
+
+     This is a first-class candidate for a primitive"
 
     |newString char1 char2
      sz         "{ Class: SmallInteger }"
@@ -1199,7 +1200,7 @@
     "
 
     "Created: 28.6.1997 / 19:19:23 / cg"
-    "Modified: 2.7.1997 / 12:08:20 / cg"
+    "Modified: 4.7.1997 / 11:01:22 / cg"
 !
 
 encodeIntoBIG5:aBIG5String
@@ -1208,7 +1209,9 @@
      This is used translate 16bit BIG5 strings into the external BIG5 encoded
      representation.
      The resulting string is only useful to be stored on some external file,
-     not for being displayed in an ST/X view."
+     not for being displayed in an ST/X view.
+
+     This is a first-class candidate for a primitive"
 
     |sz "{ Class: SmallInteger }"
      b  "{ Class: SmallInteger }"
@@ -1236,15 +1239,16 @@
     ^ out contents
 
     "Created: 17.4.1996 / 17:17:50 / cg"
-    "Modified: 30.6.1997 / 15:57:42 / cg"
+    "Modified: 4.7.1997 / 11:01:57 / cg"
 !
 
 encodeIntoEUC:aJISString
     "return a new string with aJISStrings characters as EUC encoded 8bit string.
      The argument must be a JIS 16 bit character string.
-
      The resulting string is only useful to be stored on some external file,
-     not for being displayed in an ST/X view."
+     not for being displayed in an ST/X view.
+
+     This is a first-class candidate for a primitive"
 
     |sz "{ Class: SmallInteger }"
      b1 "{ Class: SmallInteger }"
@@ -1260,29 +1264,25 @@
 
     1 to:sz do:[:srcIndex |
         b1 := (c := aJISString at:srcIndex) asciiValue.
-        b1 < 33 ifTrue:[
-            "/ a control character    
+        b1 < 161 ifTrue:[
+            "/ a control or roman character    
             out nextPut:c.
         ] ifFalse:[
-            b1 < 161 ifTrue:[
-                "/ a roman character    
-                out nextPut:c.
-            ] ifFalse:[
-                "/ check for a roman character
-                "/ the two numbers below are romanTable min and romanTable max
-                "/
-                (b1 between:16r2121 and:16r2573) ifTrue:[
-                    val := romans indexOf:b1.
-                    (val ~~ 0 and:[val <= 127]) ifTrue:[
-                        out nextPut:(Character value:(val - 1 + 32))
-                    ] ifFalse:[
-                        out nextPut:(Character value:(b1 bitShift:-8) + 128).
-                        out nextPut:(Character value:(b1 bitAnd:16rFF) + 128).
-                    ].
+            "/
+            "/ check for a roman character
+            "/ the two numbers below are romanTable min and romanTable max
+            "/
+            (b1 between:16r2121 and:16r2573) ifTrue:[
+                val := romans indexOf:b1.
+                (val ~~ 0 and:[val <= 127]) ifTrue:[
+                    out nextPut:(Character value:(val - 1 + 32))
                 ] ifFalse:[
                     out nextPut:(Character value:(b1 bitShift:-8) + 128).
                     out nextPut:(Character value:(b1 bitAnd:16rFF) + 128).
-                ]
+                ].
+            ] ifFalse:[
+                out nextPut:(Character value:(b1 bitShift:-8) + 128).
+                out nextPut:(Character value:(b1 bitAnd:16rFF) + 128).
             ]
         ].
     ].
@@ -1294,7 +1294,7 @@
     "
 
     "Created: 17.4.1996 / 16:13:33 / cg"
-    "Modified: 4.7.1997 / 10:42:25 / cg"
+    "Modified: 4.7.1997 / 11:03:43 / cg"
 !
 
 encodeIntoGB:aGBString
@@ -1303,7 +1303,9 @@
      This is used translate 16bit GB strings into the external GB encoded
      representation.
      The resulting string is only useful to be stored on some external file,
-     not for being displayed in an ST/X view."
+     not for being displayed in an ST/X view.
+
+     This is a first-class candidate for a primitive"
 
     |sz "{ Class: SmallInteger }"
      b  "{ Class: SmallInteger }"
@@ -1330,7 +1332,7 @@
     ^ out contents
 
     "Created: 30.6.1997 / 15:48:35 / cg"
-    "Modified: 30.6.1997 / 15:57:49 / cg"
+    "Modified: 4.7.1997 / 11:02:13 / cg"
 !
 
 encodeIntoJIS7:aJISString
@@ -1446,63 +1448,58 @@
 
     1 to:sz do:[:srcIndex |
         val := (c := aJISString at:srcIndex) asciiValue.
-        val < 33 ifTrue:[
-            "/ a control character    
+        val <= 128 ifTrue:[
+            "/ a control or ascii character    
             out nextPut:c.
         ] ifFalse:[
-            val <= 128 ifTrue:[
+            (val > 150 and:[val < 224]) ifTrue:[
                 "/ ascii subset
                 out nextPut:c.
             ] ifFalse:[
-                (val > 150 and:[val < 224]) ifTrue:[
-                    "/ ascii subset
+                "/ should not happen ...
+                val <= 255 ifTrue:[
                     out nextPut:c.
                 ] ifFalse:[
-                    "/ should not happen ...
-                    val <= 255 ifTrue:[
-                        out nextPut:c.
-                    ] ifFalse:[
-                        isSJIS := true.
-
-                        "/ check for HALFWIDTH KATAKANA
-                        "/ 8E:xx
-
-                        (val bitAnd:16rFF00) == 16r8E00 ifTrue:[
-                            |b|
-
-                            b := (val bitAnd:16rFF) + 128.
-                            (b >= 16rA1 "161" and:[b <= 16rDF "223"]) ifTrue:[
-                                out nextPut:(Character value:b).
+                    isSJIS := true.
+
+                    "/ check for HALFWIDTH KATAKANA
+                    "/ 8E:xx
+
+                    (val bitAnd:16rFF00) == 16r8E00 ifTrue:[
+                        |b|
+
+                        b := (val bitAnd:16rFF) + 128.
+                        (b >= 16rA1 "161" and:[b <= 16rDF "223"]) ifTrue:[
+                            out nextPut:(Character value:b).
+                            isSJIS := false.
+                        ].
+                    ].
+
+                    isSJIS ifTrue:[
+
+                        "/ check for a roman character
+                        "/ the two numbers below are romanTable min and romanTable max
+                        "/
+                        (val between:16r2121 and:16r2573) ifTrue:[
+                            rval := romans indexOf:val.
+                            rval ~~ 0 ifTrue:[
+                                out nextPut:(Character value:(rval - 1 + 32)).
                                 isSJIS := false.
                             ].
                         ].
-
-                        isSJIS ifTrue:[
-
-                            "/ check for a roman character
-                            "/ the two numbers below are romanTable min and romanTable max
-                            "/
-                            (val between:16r2121 and:16r2573) ifTrue:[
-                                rval := romans indexOf:val.
-                                rval ~~ 0 ifTrue:[
-                                    out nextPut:(Character value:(rval - 1 + 32)).
-                                    isSJIS := false.
-                                ].
-                            ].
-                        ].
-
-                        isSJIS ifTrue:[
-                            |b1 b2 rowOffset cellOffset|
-
-                            b1 := (val bitShift:-8).
-                            b2 := (val bitAnd:16rFF).
-                            rowOffset := (b1 < 95) ifTrue:[112] ifFalse:[176].
-                            cellOffset := b1 odd ifTrue:[(b2 > 95) ifTrue:[32] ifFalse:[31]]
-                                                 ifFalse:[126].
-
-                            out nextPut:(Character value:(((b1 + 1) bitShift:-1) + rowOffset)).
-                            out nextPut:(Character value:b2 + cellOffset).
-                        ]
+                    ].
+
+                    isSJIS ifTrue:[
+                        |b1 b2 rowOffset cellOffset|
+
+                        b1 := (val bitShift:-8).
+                        b2 := (val bitAnd:16rFF).
+                        rowOffset := (b1 < 95) ifTrue:[112] ifFalse:[176].
+                        cellOffset := b1 odd ifTrue:[(b2 > 95) ifTrue:[32] ifFalse:[31]]
+                                             ifFalse:[126].
+
+                        out nextPut:(Character value:(((b1 + 1) bitShift:-1) + rowOffset)).
+                        out nextPut:(Character value:b2 + cellOffset).
                     ]
                 ]
             ]
@@ -1516,7 +1513,7 @@
     "
 
     "Created: 28.6.1997 / 21:13:27 / cg"
-    "Modified: 2.7.1997 / 12:07:56 / cg"
+    "Modified: 4.7.1997 / 11:04:32 / cg"
 !
 
 encodeRomans:aTwoByteString
@@ -4838,6 +4835,6 @@
 !CharacterArray class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/CharacterArray.st,v 1.125 1997-07-04 08:45:06 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/CharacterArray.st,v 1.126 1997-07-04 09:23:39 cg Exp $'
 ! !
 CharacterArray initialize!