--- a/CharacterEncoder.st Fri Mar 12 13:28:06 2004 +0100
+++ b/CharacterEncoder.st Fri Mar 12 13:44:47 2004 +0100
@@ -199,13 +199,17 @@
"
!
-encoderFor:encodingNameSymbol ifAbsent:exceptionValue
+encoderFor:encodingNameSymbolArg ifAbsent:exceptionValue
"given the name of an encoding, return an encoder-instance which can map these from/into unicode."
- |enc clsName cls lcName name unicodeEncoders unicodeEncoderClasses|
+ |encodingNameSymbol enc clsName cls lcName name unicodeEncoders unicodeEncoderClasses|
+ encodingNameSymbol := encodingNameSymbolArg.
encodingNameSymbol isNil ifTrue:[ ^ NullEncoderInstance].
+ encodingNameSymbol == #'iso10646-1' ifTrue:[ encodingNameSymbol := #'unicode'].
+ encodingNameSymbol isSymbol ifFalse:[self halt:'symbol argument expected'. encodingNameSymbol := encodingNameSymbol asSymbol].
+
lcName := encodingNameSymbol asLowercase.
name := lcName asSymbolIfInterned.
name isNil ifTrue:[name := lcName].
@@ -790,22 +794,25 @@
(subSetEncoding match:superSetEncoding) ifTrue:[^ true].
(('iso10646*' match:superSetEncoding) or:[superSetEncoding = 'unicode']) ifTrue:[
- ('ascii*' match:subSetEncoding) ifTrue:[^ true].
- ('iso8859*' match:subSetEncoding) ifTrue:[^ true].
- ('jis*' match:subSetEncoding) ifTrue:[^ true].
- ('koi8*' match:subSetEncoding) ifTrue:[^ true].
- ('ksc*' match:subSetEncoding) ifTrue:[^ true].
- ('big*' match:subSetEncoding) ifTrue:[^ true].
- ('cns*' match:subSetEncoding) ifTrue:[^ true].
- ('gb2312*' match:subSetEncoding) ifTrue:[^ true].
+ ('ms-*' match:subSetEncoding) ifTrue:[^ true].
+ ('ascii*' match:subSetEncoding) ifTrue:[^ true].
+ ('iso8859*' match:subSetEncoding) ifTrue:[^ true].
+ ('jis*' match:subSetEncoding) ifTrue:[^ true].
+ ('koi8*' match:subSetEncoding) ifTrue:[^ true].
+ ('ksc*' match:subSetEncoding) ifTrue:[^ true].
+ ('big*' match:subSetEncoding) ifTrue:[^ true].
+ ('cns*' match:subSetEncoding) ifTrue:[^ true].
+ ('gb2312*' match:subSetEncoding) ifTrue:[^ true].
].
"/ if the subSet is iso8859-*, that means ascii (i.e. the lower 7 bits of iso8859 only).
((subSetEncoding = 'iso8859*') or:[subSetEncoding = 'iso8859-*']) ifTrue:[
- ('ascii*' match:superSetEncoding) ifTrue:[^ true].
+ ('ascii*' match:superSetEncoding) ifTrue:[^ true].
+ ('ms-ansi*' match:superSetEncoding) ifTrue:[^ true].
].
(subSetEncoding = 'ascii') ifTrue:[
- ('iso8859*' match:superSetEncoding) ifTrue:[^ true].
+ ('iso8859*' match:superSetEncoding) ifTrue:[^ true].
+ ('ms-ansi*' match:superSetEncoding) ifTrue:[^ true].
].
"/ TODO: check the charSets mappingTables...
@@ -1243,7 +1250,7 @@
!CharacterEncoder class methodsFor:'documentation'!
version
- ^ '$Header: /cvs/stx/stx/libbasic/CharacterEncoder.st,v 1.72 2004-03-10 16:11:42 ca Exp $'
+ ^ '$Header: /cvs/stx/stx/libbasic/CharacterEncoder.st,v 1.73 2004-03-12 12:44:47 cg Exp $'
! !
CharacterEncoder initialize!