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.28 date: 2024/02/18 08:16:36
user: cg
file: Unicode32String.st directory: libbasic2
module: stx stc-classLibrary: libbasic2

Description:


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

copyright

COPYRIGHT (c) 2004 by eXept Software AG All Rights Reserved This software is furnished under a license and may be used only in accordance with the terms of that license and with the inclusion of the above copyright notice. This software may not be provided or otherwise made available to, or used by, any other person. No title to or ownership of the software is hereby transferred.

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' 16-bit string,
with invalid characters replaced by replacementCharacter.
Can be used to convert from 32-bit strings to 16-bit strings
and replace characters above code-0xFFFF 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  displayOn: aGCOrStream
display myself as on aStream.
You must use an ISO10646 unicode font to display this string

o  printOn: aStream
print the receiver on aStream.
Let aStream decide how to represent this, whether UTF-8, UTF-16, ...

encoding
o  utf8Encoded
tuned version of the inherited encoder;
this is so heavily used, that it is worth a primitive

printing & storing
o  storeOn: aStream
put the storeString of myself on aStream.
Convert it to something that can be written to a plain ASCII file.
Use #unicodeStoreOn: if you want to use the result internally,
especially when writing to an EncodedStream.

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.
Convert it to something that can be written to a plain ASCII file.
Use #unicodeStoreString if you want to use the result internally,
especially when writing to an EncodedStream.

Usage example(s):

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

testing
o  isLiteral
return true, if the receiver can be used as a literal constant in ST syntax
(i.e. can be used in constant arrays)

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 use unicode encoding



ST/X 7.7.0.0; WebServer 1.702 at 20f6060372b9.unknown:8081; Sun, 22 Dec 2024 09:14:55 GMT