#TUNING by stefan
authorStefan Vogel <sv@exept.de>
Wed, 10 Jan 2018 22:55:27 +0100
changeset 22412 e2516a1b3b82
parent 22411 0aa3288a46bb
child 22413 b40bbf08ddd8
#TUNING by stefan class: Character class changed: #utf8DecodeFrom:
Character.st
--- a/Character.st	Wed Jan 10 21:24:41 2018 +0100
+++ b/Character.st	Wed Jan 10 22:55:27 2018 +0100
@@ -1,5 +1,3 @@
-"{ Encoding: utf8 }"
-
 "
  COPYRIGHT (c) 1988 by Claus Gittinger
 	      All Rights Reserved
@@ -203,7 +201,7 @@
     "read and return a single unicode character from an UTF8 encoded stream.
      Answer nil, if Stream>>#next answers nil."
 
-    |fetchNext c1 c2 codePoint|
+    |fetchNext c1 c2 codePoint "{ Class:SmallInteger }"|
 
     c1 := aStream next.
     c1 isNil ifTrue:[
@@ -221,11 +219,11 @@
         ^ c1 asCharacter.
     ].
 
-    fetchNext := [  |code|
+    fetchNext := [  |code "{ Class:SmallInteger }"|
                     code := aStream next codePoint.
                     (code bitAnd:2r11000000) == 2r10000000 ifFalse:[
                         "/ followup chars must have 2r10 in high bits
-                        InvalidEncodingError raiseRequestWith:code.
+                        InvalidEncodingError raiseRequestWith:code errorString:' - utf8: bad followup character'.
                         ^ c1 asCharacter.
                     ].
                     code bitAnd:16r3F
@@ -304,7 +302,7 @@
 
       |utf8Encoding original readBack|
 
-      1 to:16rFFFF do:[:codePoint |
+      1 to:16r3fFFFF do:[:codePoint |
         original := Character value:codePoint.
         utf8Encoding := original utf8Encoded.
         readBack := Character utf8DecodeFrom:(utf8Encoding readStream).
@@ -314,7 +312,7 @@
       ]
     "
 
-    "Modified (comment): / 10-01-2018 / 10:31:03 / stefan"
+    "Modified: / 10-01-2018 / 22:53:31 / stefan"
 !
 
 value:anInteger