[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Help-smalltalk] Re: [bug] putting character in a stream

From: Paolo Bonzini
Subject: [Help-smalltalk] Re: [bug] putting character in a stream
Date: Thu, 05 Mar 2009 02:47:28 -0700

Issue status update for Post a follow up:

Project:      GNU Smalltalk
Version:      <none>
Component:    Base classes
Category:     bug reports
Priority:     normal
Assigned to:  Unassigned
Reported by:  swoolerton
Updated by:   bonzinip
-Status:       active
+Status:       invalid

The problem is that asCharacter (by design) returns a UnicodeCharacter
when given a character that is >128.  You need to use (Character value:
byte) to explicitly request a Character:

st> (Character value: 128) class
st> (Character codePoint: 128) class
st> 128 asCharacter class

For ease of use, Characters and UnicodeCharacters are the same for the
range 0-127.  This works because sane representations of Unicode are
backwards compatible with 7-bit ASCII, but does not work for the range
128-255.  A Character in the range 128-255 is the /octet 128-255 stored
in a representation of a Unicode string/ (i.e. in a String), while a
UnicodeCharacter in the range 128-255 is the /character 128-255 of the
Unicode character set/.

I'll open another issue for the Transcript deadlock.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]