Re: String Theory
January 9th, 2008
Robert O'Callahan discussed various approaches to string representation.
I think Io takes a sensible approach to Strings. Io represents strings as sequences (C arrays) of bytes. Each sequence is associated with a type that holds information of the number of bytes that represent an element in the sequence. Multibyte strings are converted to their smallest fixed with encoding, allowing a coherent String interface (size ... etc work as expected). This conversion only happens for strings that contain multibyte characters, so space is only traded for coherence / speed when needed.

Leave a Reply