#BUGFIX by stefan
class: CharacterEncoder class
changed: #encoderFor:ifAbsent:
return a NULEncoder when encoding from unicode to unicode
--- a/CharacterEncoder.st Mon Mar 05 15:19:40 2018 +0100
+++ b/CharacterEncoder.st Mon Mar 05 16:05:20 2018 +0100
@@ -1,5 +1,3 @@
-"{ Encoding: utf8 }"
-
"
COPYRIGHT (c) 2004 by eXept Software AG
All Rights Reserved
@@ -271,10 +269,15 @@
|encodingNameSymbol enc clsName cls unicodeEncoders unicodeEncoderClasses|
- encodingNameSymbolArg isNil ifTrue:[ ^ NullEncoderInstance].
+ encodingNameSymbolArg isNil ifTrue:[
+ ^ NullEncoderInstance
+ ].
encodingNameSymbol := encodingNameSymbolArg asLowercase asSymbolIfInternedOrSelf.
- encodingNameSymbol == #'iso10646-1' ifTrue:[encodingNameSymbol := #unicode].
+ (encodingNameSymbol == #'iso10646-1' or:[encodingNameSymbol == #unicode]) ifTrue:[
+ "encode unicode from/into unicode"
+ ^ NullEncoderInstance
+ ].
encodingNameSymbol includesMatchCharacters ifTrue:[
AccessLock critical:[
@@ -405,6 +408,7 @@
"
CharacterEncoder encoderFor:#'latin1'
+ self encoderFor:#'iso10646-1'
self encoderFor:#'arabic'
self encoderFor:#'ms-arabic'
self encoderFor:#'iso8859-5'
@@ -418,7 +422,7 @@
"
"Modified: / 12-07-2012 / 19:45:58 / cg"
- "Modified: / 27-02-2017 / 16:47:40 / stefan"
+ "Modified (comment): / 05-03-2018 / 16:04:52 / stefan"
!
encoderForUTF8
@@ -884,7 +888,7 @@
"
self encodeString:(self encodeString:'hello' into:#ebcdic) from:#ebcdic into:#ascii
self encodeString:(self encodeString:'hello' into:#ebcdic) from:#ebcdic into:#unicode
- self encodeString:(self encodeString:'Äh ... hello' into:#ebcdic) from:#ebcdic into:#utf8
+ self encodeString:(self encodeString:'Äh ... hello' into:#ebcdic) from:#ebcdic into:#utf8
"
"Modified (comment): / 17-01-2018 / 15:49:40 / stefan"