#TUNING by stefan
class: CharacterEncoderImplementations::ISO10646_to_UTF16BE
added:
#encodeCharacter:on:
#encodeString:on:
--- 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'!