|
Class: Unicode32String
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
Not yet fully finished - unicode support is still being implemented.
copyrightCOPYRIGHT (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.
initialization
-
initialize
-
initialize the class - private
Usage example(s):
Unicode32String initialize
|
reading
-
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
|
conversion
-
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.
-
asUnicode32String
-
as the receiver already is a unicode-32 string, return it
-
asUnicodeString
-
as the receiver already is a unicode string, return it
-
displayOn: aGCOrStream
-
display myself as on aStream.
You must use an ISO10646 unicode font to display this string
-
printOn: aStream
-
print the receiver on aStream.
Let aStream decide how to represent this, whether UTF-8, UTF-16, ...
encoding
-
utf8Encoded
-
tuned version of the inherited encoder;
this is so heavily used, that it is worth a primitive
printing & storing
-
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
].
|
-
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
-
isLiteral
-
return true, if the receiver can be used as a literal constant in ST syntax
(i.e. can be used in constant arrays)
-
isUnicode32String
-
true if this is a 4-byte unicode string
-
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
|