#FEATURE by Stefan Reise
authorsr
Wed, 19 Feb 2020 16:17:53 +0100
changeset 25270 abd76d94ad4f
parent 25269 55eb9e01d1da
child 25271 3b763ce09c7e
#FEATURE by Stefan Reise class: CharacterEncoderImplementations::ISO10646_to_UTF16BE removed: #isUtf16EncoderEncoder class: ISO10646_to_UTF16BE added: #isUtf16Encoder #isUtf16EncoderEncoder #isUtfEncoder
CharacterEncoderImplementations__ISO10646_to_UTF16BE.st
--- a/CharacterEncoderImplementations__ISO10646_to_UTF16BE.st	Wed Feb 19 16:17:35 2020 +0100
+++ b/CharacterEncoderImplementations__ISO10646_to_UTF16BE.st	Wed Feb 19 16:17:53 2020 +0100
@@ -1,3 +1,5 @@
+"{ Encoding: utf8 }"
+
 "
  COPYRIGHT (c) 2005 by eXept Software AG
               All Rights Reserved
@@ -59,7 +61,7 @@
   Decoding (utf16BE to unicode):
      |t|
 
-     t := ISO10646_to_UTF16BE encodeString:'ÄÖÜß'.
+     t := ISO10646_to_UTF16BE encodeString:'ÄÖÜß'.
      ISO10646_to_UTF16BE decodeString:t.
 
   Decoding (utf16LE-Bytes to unicode):
@@ -299,6 +301,25 @@
     "Modified: / 17-01-2018 / 14:41:31 / stefan"
 ! !
 
+!ISO10646_to_UTF16BE methodsFor:'testing'!
+
+isUtf16Encoder
+    "answer true, if this encodes from/to UTF-16 (regardless of byte-order)"
+
+    ^ true
+
+    "Created: / 19-02-2020 / 16:15:36 / Stefan Reise"
+!
+
+isUtfEncoder
+    "answer true, if this encodes from/to any UTF (regardless of how many bytes and byte-order).
+     In other words: does it make sense to prepend a BOM"
+
+    ^ true
+
+    "Created: / 19-02-2020 / 16:15:47 / Stefan Reise"
+! !
+
 !ISO10646_to_UTF16BE class methodsFor:'documentation'!
 
 version