Back: I18N.BigEndianFileStream Up: Iconv/I18N packages Forward: I18N.EncodedStream class-initializing   Top: GNU Smalltalk Library Reference Contents: Table of Contents Index: Class index About: About this document

5.2 I18N.EncodedStream

Defined in namespace I18N
Superclass: Stream
Category: i18n-Character sets
This class is a factory for subclasses of Encoder. Encoders act as parts of a pipe, hence this class provides methods that construct an appropriate pipe.

5.2.1 I18N.EncodedStream class: initializing  (class)
5.2.2 I18N.EncodedStream class: instance creation  (class)


5.2.1 I18N.EncodedStream class: initializing

initialize
Initialize the registry of the encoders to include the standard encoders contained in the library.

registerEncoderFor: arrayOfAliases toUTF32: toUTF32Class fromUTF32: fromUTF32Class
Register the two classes that will respectively convert from the charsets in arrayOfAliases to UTF-32 and vice versa.

The former class is a stream that accepts characters and returns (via #next) integers representing UTF-32 character codes, while the latter accepts UTF-32 character codes and converts them to characters. For an example see respectively FromUTF7 and ToUTF7 (I admit it is not a trivial example).


5.2.2 I18N.EncodedStream class: instance creation

encoding: anUnicodeString
Answer a pipe of encoders that converts anUnicodeString to default encoding for strings (the current locale's default charset if none is specified).

encoding: aStringOrStream as: toEncoding
Answer a pipe of encoders that converts anUnicodeString (which contains to the supplied encoding (which can be an ASCII String or Symbol).

on: aStringOrStream from: fromEncoding
Answer a pipe of encoders that converts aStringOrStream (which can be a string or another stream) from the given encoding to the default locale's default charset.

on: aStringOrStream from: fromEncoding to: toEncoding
Answer a pipe of encoders that converts aStringOrStream (which can be a string or another stream) between the two supplied encodings (which can be ASCII Strings or Symbols)

on: aStringOrStream to: toEncoding
Answer a pipe of encoders that converts aStringOrStream (which can be a string or another stream) from the default locale's default charset to the given encoding.

unicodeOn: aStringOrStream
Answer a pipe of encoders that converts aStringOrStream (which can be a string or another stream) from its encoding (or the current locale's default charset, if the encoding cannot be determined) to integers representing Unicode character codes.

unicodeOn: aStringOrStream encoding: fromEncoding
Answer a pipe of encoders that converts aStringOrStream (which can be a string or another stream) from the supplied encoding (which can be an ASCII String or Symbol) to integers representing Unicode character codes.



Back: I18N.EncodedStream class-initializing Up: I18N.EncodedStream Forward: I18N.EncodedString   Top: GNU Smalltalk Library Reference Contents: Table of Contents Index: Class index About: About this document


This document was generated on August, 19 2010 using texi2html