eXept Software AG Logo

Smalltalk/X Webserver

Documentation of class 'Unicode32String':

Home

Documentation
www.exept.de
Everywhere
for:
[back]

Class: Unicode32String


Inheritance:

   Object
   |
   +--Collection
      |
      +--SequenceableCollection
         |
         +--ArrayedCollection
            |
            +--UninterpretedBytes
               |
               +--CharacterArray
                  |
                  +--FourByteString
                     |
                     +--Unicode32String

Package:
stx:libbasic2
Category:
Collections-Text
Version:
rev: 1.19 date: 2019/05/28 12:47:31
user: stefan
file: Unicode32String.st directory: libbasic2
module: stx stc-classLibrary: libbasic2

Description:


Not yet fully finished - unicode support is still being implemented.


Class protocol:

initialization
o  initialize
initialize the class - private

usage example(s):

     Unicode32String initialize

reading
o  readFrom: aStreamOrString onError: exceptionBlock
read & return the next String from the (character-)stream aStream;
skipping all whitespace first; return the value of exceptionBlock,
if no string can be read. The sequence of characters as read from the
stream must be one as stored via storeOn: or storeString.

usage example(s):

        self readFrom:'abcäöü' storeString
        String readFrom:'abcäöü' storeString


Instance protocol:

conversion
o  asUnicode16StringReplaceInvalidWith: replacementCharacter
return the receiver converted to a 'normal' string,
with invalid characters replaced by replacementCharacter.
Can be used to convert from 16-bit strings to 8-bit strings
and replace characters above code-255 with some replacement.

o  asUnicode32String
as the receiver already is a unicode-32 string, return it

o  asUnicodeString
as the receiver already is a unicode string, return it

o  printOn: aStream
print the receiver on aStream.
Let aStream decide how to represent this, whether utf8, ucs16, ...

printing & storing
o  storeOn: aStream
put the storeString of myself on aStream

usage example(s):

        String streamContents:[:s|
            'hello' asUnicode32String storeOn:s
        ].

        String streamContents:[:s|
            'hello -öäüß' asUnicode32String storeOn:s
        ].

o  storeString
return a String for storing myself

usage example(s):

        'hello' asUnicode32String storeString
        'hello -öäüß' storeString
        'hello -öäüß' asUnicode32String storeString

o  unicodeStoreOn: aStream
put the storeString of myself on aStream

o  unicodeStoreString
return a UnicodeString for storing myself.
This method is a kind of kludge.
Use it when you want to write a storeString to an encoded Stream

testing
o  isUnicode32String
true if this is a 4-byte unicode string

o  isUnicodeString
true if this is a 2- or 4-byte unicode string
(i.e. not a single byte string).
Notice, that the name is misleading:
all strings are use unicode encoding



ST/X 7.2.0.0; WebServer 1.670 at bd0aa1f87cdd.unknown:8081; Sat, 20 Apr 2024 03:59:56 GMT