UTF8TextConverter and Latin1TextConverter examples
Last updated at 11:00 am UTC on 4 October 2017
Evaluation of
(UTF8TextConverter new encodeString: 'Les élèves Français') asByteArray
gives
#[76 101 115 32 195 169 108 195 168 118 101 115 32 70 114 97 110 195 167 97 105 115]
This gives the same result
'Les élèves Français' squeakToUtf8 asByteArray
#[76 101 115 32 195 169 108 195 168 118 101 115 32 70 114 97 110 195 167 97 105 115]
(Latin1TextConverter new encodeString: 'Les élèves Français') asByteArray
#[76 101 115 32 233 108 232 118 101 115 32 70 114 97 110 231 97 105 115]
The Latin1TextConverter is for ISO 8859-1, an international encoding used in Western Europe.
UTF8TextConverter decodeByteString:
(ByteString fromByteArray:
#[76 101 115 32 195 169 108 195 168 118 101 115 32 70 114 97 110 195 167 97 105 115])
'Les élèves Français'