--- a/CharacterArray.st Mon Jun 30 21:17:47 1997 +0200
+++ b/CharacterArray.st Tue Jul 01 00:09:33 1997 +0200
@@ -2967,24 +2967,29 @@
|newString|
- encodingSymbol == #jis7 ifTrue:[
+ encodingSymbol == #'x-jis7' ifTrue:[
^ JISEncodedString decodeFromJIS7:self
].
- encodingSymbol == #sjis ifTrue:[
+ encodingSymbol == #'x-sjis' ifTrue:[
^ JISEncodedString decodeFromSJIS:self
].
- encodingSymbol == #euc ifTrue:[
+ encodingSymbol == #'x-shift-jis' ifTrue:[
+ ^ JISEncodedString decodeFromSJIS:self
+ ].
+ encodingSymbol == #'x-euc-jp' ifTrue:[
^ JISEncodedString decodeFromEUC:self
].
-
encodingSymbol == #big5 ifTrue:[
^ BIG5EncodedString decodeFromBIG5:self
].
- encodingSymbol == #gb ifTrue:[
+ encodingSymbol == #gb2312 ifTrue:[
^ GBEncodedString decodeFromGB:self
].
- encodingSymbol == #ksc ifTrue:[
- ^ KSCEncodedString decodeFromKSC:self
+ encodingSymbol == #'x-euc-gb' ifTrue:[
+ ^ GBEncodedString decodeFromEUC:self
+ ].
+ encodingSymbol == #'x-euc-kr' ifTrue:[
+ ^ KSCEncodedString decodeFromEUC:self
].
encodingSymbol == #ucs2 ifTrue:[
@@ -3003,13 +3008,33 @@
^ UnicodeString decodeFromUTF16:self
].
+
+ "/ soon obsolete ...
+ encodingSymbol == #jis7 ifTrue:[
+ ^ JISEncodedString decodeFromJIS7:self
+ ].
+ encodingSymbol == #sjis ifTrue:[
+ ^ JISEncodedString decodeFromSJIS:self
+ ].
+ encodingSymbol == #euc ifTrue:[
+ ^ JISEncodedString decodeFromEUC:self
+ ].
+
+ encodingSymbol == #gb ifTrue:[
+ ^ GBEncodedString decodeFromGB:self
+ ].
+ encodingSymbol == #ksc ifTrue:[
+ ^ KSCEncodedString decodeFromKSC:self
+ ].
+
+
newString := self class new:self size.
newString replaceFrom:self decode:encodingSymbol.
newString = self ifTrue:[^ self].
^ newString
"Created: 22.2.1996 / 15:06:49 / cg"
- "Modified: 30.6.1997 / 16:17:40 / cg"
+ "Modified: 30.6.1997 / 23:51:42 / cg"
!
encodeForDisplayInto:encodingSymbol
@@ -3050,9 +3075,10 @@
and return a corresponding CharacterArray.
Currently, only a few encodings are supported
(and those are untested/incomplete):
- #euc
- #jis7
- #sjis
+ #x-euc-jp
+ #x-jis7
+ #x-sjis
+ #x-shift-jis
#big5
#gb
#mac
@@ -3066,24 +3092,31 @@
encodingSymbol isNil ifTrue:[^ self].
- encodingSymbol == #jis7 ifTrue:[
+ encodingSymbol == #'x-jis7' ifTrue:[
^ JISEncodedString encodeIntoJIS7:self
].
- encodingSymbol == #sjis ifTrue:[
+ encodingSymbol == #'x-sjis' ifTrue:[
^ JISEncodedString encodeIntoSJIS:self
].
- encodingSymbol == #euc ifTrue:[
+ encodingSymbol == #'x-shift-jis' ifTrue:[
+ ^ JISEncodedString encodeIntoSJIS:self
+ ].
+ encodingSymbol == #'x-euc-jp' ifTrue:[
^ JISEncodedString encodeIntoEUC:self
].
encodingSymbol == #big5 ifTrue:[
^ BIG5EncodedString encodeIntoBIG5:self
].
- encodingSymbol == #gb ifTrue:[
+
+ encodingSymbol == #gb2312 ifTrue:[
^ GBEncodedString encodeIntoGB:self
].
-
- encodingSymbol == #ksc ifTrue:[
+ encodingSymbol == #'x-euc-gb' ifTrue:[
+ ^ GBEncodedString encodeIntoGB:self
+ ].
+
+ encodingSymbol == #'x-euc-kr' ifTrue:[
^ KSCEncodedString encodeIntoKSC:self
].
@@ -3103,13 +3136,32 @@
^ UnicodeString encodeIntoUTF16:self
].
+
+ "/ to be obsoleted ...
+ encodingSymbol == #jis7 ifTrue:[
+ ^ JISEncodedString encodeIntoJIS7:self
+ ].
+ encodingSymbol == #sjis ifTrue:[
+ ^ JISEncodedString encodeIntoSJIS:self
+ ].
+ encodingSymbol == #euc ifTrue:[
+ ^ JISEncodedString encodeIntoEUC:self
+ ].
+
+ encodingSymbol == #gb ifTrue:[
+ ^ GBEncodedString encodeIntoGB:self
+ ].
+ encodingSymbol == #ksc ifTrue:[
+ ^ KSCEncodedString encodeIntoKSC:self
+ ].
+
newString := self class new:self size.
newString replaceFrom:self encode:encodingSymbol.
newString = self ifTrue:[^ self].
^ newString
"Created: 22.2.1996 / 15:07:31 / cg"
- "Modified: 30.6.1997 / 16:30:33 / cg"
+ "Modified: 30.6.1997 / 23:50:41 / cg"
!
replaceFrom:aString decode:encoding
@@ -4702,6 +4754,6 @@
!CharacterArray class methodsFor:'documentation'!
version
- ^ '$Header: /cvs/stx/stx/libbasic/CharacterArray.st,v 1.120 1997-06-30 19:17:47 cg Exp $'
+ ^ '$Header: /cvs/stx/stx/libbasic/CharacterArray.st,v 1.121 1997-06-30 22:09:33 cg Exp $'
! !
CharacterArray initialize!