#BUGFIX by sr
authorsr
Thu, 14 Sep 2017 12:35:59 +0200
changeset 22252 097e84ab142e
parent 22251 a1ebd9c9af37
child 22253 e1b728149a94
#BUGFIX by sr class: Stream changed: #nextPutUtf8:
Stream.st
--- a/Stream.st	Thu Sep 14 12:35:46 2017 +0200
+++ b/Stream.st	Thu Sep 14 12:35:59 2017 +0200
@@ -1,3 +1,5 @@
+"{ Encoding: utf8 }"
+
 "
  COPYRIGHT (c) 1989 by Claus Gittinger
 	      All Rights Reserved
@@ -239,6 +241,7 @@
     self nextPut:(Character nl)
 ! !
 
+
 !Stream methodsFor:'accessing'!
 
 contents
@@ -2044,7 +2047,7 @@
 
     "
         (#[] writeStream
-            nextPutAllUtf16Bytes:'BÄxxx' MSB:true;
+            nextPutAllUtf16Bytes:'BÄxxx' MSB:true;
             nextPutUtf16:(Character codePoint:16r10CCCC) MSB:true;
             contents)
    "
@@ -2079,15 +2082,15 @@
         ].
 
         String streamContents:[:s|
-            s nextPutAllUtf8:'abcdeäöüß' asUnicode32String
+            s nextPutAllUtf8:'abcdeäöüß' asUnicode32String
         ].
 .
         ByteArray streamContents:[:s|
-            s nextPutAllUtf8:'abcdeäöüß' asUnicode32String
+            s nextPutAllUtf8:'abcdeäöüß' asUnicode32String
         ].
 
         '/tmp/bytes' asFilename writingFileDo:[:s|
-            s nextPutAllUtf8:'abcdeäöüß'
+            s nextPutAllUtf8:'abcdeäöüß'
         ].
     "
 
@@ -2498,7 +2501,7 @@
     "
         ((WriteStream on:Unicode16String new)
             nextPutUtf16:$B;
-            nextPutUtf16:$Ä; 
+            nextPutUtf16:$Ä; 
             nextPutUtf16:(Character codePoint:16r10CCCC)
             yourself) contents
     "
@@ -2534,19 +2537,19 @@
     "
         (#[] writeStream
             nextPutUtf16Bytes:$B MSB:true;
-            nextPutUtf16Bytes:$Ä MSB:true;
+            nextPutUtf16Bytes:$Ä MSB:true;
             nextPutUtf16Bytes:(Character codePoint:16r10CCCC) MSB:true;
             contents)
 
         ('' writeStream
             nextPutUtf16Bytes:$B MSB:true;
-            nextPutUtf16Bytes:$Ä MSB:true;
+            nextPutUtf16Bytes:$Ä MSB:true;
             nextPutUtf16Bytes:(Character codePoint:16r10CCCC) MSB:true;
             contents)
 
         (FileStream newTemporary
             nextPutUtf16Bytes:$B MSB:false;
-            nextPutUtf16Bytes:$Ä MSB:false;
+            nextPutUtf16Bytes:$Ä MSB:false;
             nextPutUtf16Bytes:(Character codePoint:16r10CCCC) MSB:false;
             reset;
             binary;
@@ -2595,7 +2598,7 @@
             nextPutByte:((codePoint bitAnd:16r3F) bitOr:16r80).
         ^ self.
     ].
-    codePoint <= 16r1FFFFF ifTrue:[
+    codePoint <= 16r3FFFFFF ifTrue:[
         "/ 26 bits - 5 byte sequence 2+6+6+6+6  
         self 
             nextPutByte:(((codePoint bitShift:-24) bitAnd:16r03) bitOr:16rF8);
@@ -2605,7 +2608,7 @@
             nextPutByte:((codePoint bitAnd:16r3F) bitOr:16r80).
         ^ self.
     ].
-    codePoint <= 16r3FFFFFF ifTrue:[
+    codePoint <= 16r7FFFFFFF ifTrue:[
         "/ 31 bits - 6 byte sequence 1+6+6+6+6+6  
         self 
             nextPutByte:(((codePoint bitShift:-30) bitAnd:16r01) bitOr:16rFC);
@@ -2658,7 +2661,7 @@
     "
       (String streamContents:[:s|
             s nextPutUtf8:$a.
-            s nextPutUtf8:$ü.
+            s nextPutUtf8:$ü.
             s nextPutUtf8: (Character value:16r1fff).
             s nextPutUtf8: (Character value:16rffff).
             s nextPutUtf8: (Character value:16r1ffffff).