*** empty log message ***
authorClaus Gittinger <cg@exept.de>
Fri, 13 Feb 2004 01:36:15 +0100
changeset 7945 d5df0089605f
parent 7944 b12a1e0a5124
child 7946 469d2d1c61f1
*** empty log message ***
CharacterArray.st
--- a/CharacterArray.st	Thu Feb 12 23:29:50 2004 +0100
+++ b/CharacterArray.st	Fri Feb 13 01:36:15 2004 +0100
@@ -4099,11 +4099,19 @@
         #next
     "
 
-    |newString table|
+    |newString table myEncoding encoder|
 
 "/  self encoding storeString print. ' -> ' print. encodingSymbol storeString printNL.
 
     encodingSymbol isNil ifTrue:[^ self].
+    myEncoding := self encoding.
+    encodingSymbol == myEncoding ifTrue:[^ self].
+
+    "/ all of the following is soon obsoleted by...
+    encoder := CharacterEncoder encoderToEncodeFrom:(self encoding) into:encodingSymbol.
+    encoder notNil ifTrue:[
+        ^ encoder encodeString:self.
+    ].
 
     encodingSymbol == #'x-jis7' ifTrue:[
         ^ JISEncodedString encodeIntoJIS7:self
@@ -4175,7 +4183,9 @@
     ].
 
     table := self class encoderTableFor:encodingSymbol.
-    table isNil ifTrue:[^ self].
+    table isNil ifTrue:[
+        ^ self
+    ].
 
     newString := self class new:self size.
     newString replaceFrom:self translateBy:table.
@@ -6310,7 +6320,7 @@
 !CharacterArray class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/CharacterArray.st,v 1.275 2004-02-12 18:40:33 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/CharacterArray.st,v 1.276 2004-02-13 00:36:15 cg Exp $'
 ! !
 
 CharacterArray initialize!