#TUNING by stefan
authorStefan Vogel <sv@exept.de>
Thu, 16 Feb 2017 20:48:27 +0100
changeset 21475 6409725581b1
parent 21474 151c0f5bf617
child 21476 680cb70d9eb9
#TUNING by stefan class: CharacterEncoderImplementations::ISO10646_to_UTF16BE added: #encodeCharacter:on: #encodeString:on:
CharacterEncoderImplementations__ISO10646_to_UTF16BE.st
--- a/CharacterEncoderImplementations__ISO10646_to_UTF16BE.st	Thu Feb 16 20:44:22 2017 +0100
+++ b/CharacterEncoderImplementations__ISO10646_to_UTF16BE.st	Thu Feb 16 20:48:27 2017 +0100
@@ -1,3 +1,5 @@
+"{ Encoding: utf8 }"
+
 "
  COPYRIGHT (c) 2005 by eXept Software AG
               All Rights Reserved
@@ -201,6 +203,14 @@
     ^ aCode
 !
 
+encodeCharacter:aUnicodeCharacter on:aStream
+    "given a string in unicode, encode it onto aStream."
+
+     aStream nextPutUtf16Bytes:aUnicodeCharacter MSB:true.
+
+    "Created: / 16-02-2017 / 16:41:25 / stefan"
+!
+
 encodeString:aUnicodeString
     "return the UTF-16 representation of a aUnicodeString.
      The resulting string is only useful to be stored on some external file,
@@ -257,6 +267,14 @@
      (self encodeString:(Character value:16rDFFF) asString) 
      (self encodeString:(Character value:16r110000) asString)   
     "
+!
+
+encodeString:aUnicodeString on:aStream
+    "given a string in unicode, encode it onto aStream."
+
+     aStream nextPutAllUtf16Bytes:aUnicodeString MSB:true.
+
+    "Created: / 16-02-2017 / 16:40:32 / stefan"
 ! !
 
 !ISO10646_to_UTF16BE methodsFor:'private'!