Utf8View
Description
A <Utf8View> provides a bidirectional view over the unicode component as a collection of UTF-8 code units. UTF-8 is an 8-bit variable-length encoding that encodes unicode scalar values in one to four 8-bit code units.
#next/#previous - Answers an 8-bit <Integer>.
#contents - Answers a <Utf8>
Examples
| view |
view := Utf8View on: 'abc'.
self assert: [view next = $a value].
self assert: [view next = $b value].
self assert: [view next = $c value].
self assert: [view atEnd].
self assert: [view previous = $c value].
self assert: [view previous = $b value].
self assert: [view previous = $a value].
self assert: [view atStart].
self assert: [view contents asArray = { $a value. $b value. $c value}]
Class Methods
None
Instance Methods
None
Last modified date: 04/20/2022