Utf8
Description
Container class containing UTF-8 encoding.
@see Class Comments in <EsUnicodeEncoding> for usage examples.
Class Methods
None
Instance Methods
asUnicodeString:
  Answer a new unicode string instance from the receiver.

     Examples:
        'Grinning Face (U+1F600)'.
        self assert: [(Utf8 with: 16rF0 with: 16r9F with: 16r98 with: 16r80) asUnicodeString first name = 'GRINNING FACE'].

        'Invalid UTF8-encoding'.
        self assert: [[(Utf8 with: 233) asUnicodeString. false] on: Exception do: [:ex | ex exitWith: true]].

        'Repaired invalid UTF8-encoding'.
        self assert: [((Utf8 with: 233) asUnicodeString: true) = UnicodeScalar replacementCharacter asUnicodeString].

     Answers:
        <UnicodeString>
isValid
  Answer true if the content of the container represents valid UTF-8 data.

     Examples:
        'Grinning Face (U+1F600)'.
        self assert: [(Utf8 with: 16rF0 with: 16r9F with: 16r98 with: 16r80) isValid].

        'Invalid UTF8-encoding'.
        self assert: [(Utf8 with: 233) isValid not]

     Answers:
        <Boolean> true if valid, false if invalid
Last modified date: 04/20/2022