Charles.Forsyth20060303-partialeea662d19 years agoHistory
84 lines · 2.4 KB · Text
RawDownload
.TH UTF 6.SH NAMEUTF, Unicode, ASCII \- character set and format.SH DESCRIPTIONThe Inferno character set and representation arebased on the Unicode Standard and on the ISO multibyte.SM UTF-8encoding (Universal CharacterSet Transformation Format, 8 bits wide).The Unicode Standard represents its characters in 16bits;.SM UTF-8represents suchvalues in an 8-bit byte stream.Throughout this manual,.SM UTF-8is shortened to.SM UTF..PPInternally, programs store individual Unicode characters as 16-bit values.However, any external manifestation of textual information,in files or at the interface between programs, uses themachine-independent, byte-stream encoding called.SM UTF..PP.SM UTFis designed so the 7-bit.SM ASCIIset (values hexadecimal 00 to 7F),appear only as themselvesin the encoding.Characters with values above 7F appear as sequences of two or morebytes with values only from 80 to FF..PPThe.SM UTFencoding of the Unicode Standard is backward compatible with.SM ASCII\c: Inferno programs handle.SM ASCIItext, as well as uninterpreted byte streams, without special arrangement.However, programs that perform semantic processing oncharacters must convert from.SM UTFto Unicodein order to work properly with non-\c.SM ASCIIinput.Normally, all necessary conversions are done by the Limbo compilerand execution environment, but sometimes more is necessary, suchas when a program receives.SM UTFinput one byte at a time;see.IR sys-byte2char (2)for routines to handle such processing..PPLetting numbers be binary,a Unicode character xis converted to a multibyte.SM UTFsequenceas follows:.EX01.   x in [00000000.0bbbbbbb] \(-> 0bbbbbbb10.   x in [00000bbb.bbbbbbbb] \(-> 110bbbbb, 10bbbbbb11.   x in [bbbbbbbb.bbbbbbbb] \(-> 1110bbbb, 10bbbbbb, 10bbbbbb.EE.PPConversion 01 provides a one-byte sequence that spans the.SM ASCIIcharacter set in a compatible way.Conversions 10 and 11 represent higher-valued charactersas sequences of two or three bytes with the high bit set.Inferno does not support the 4-, 5-, and 6-byte sequences proposed by X-Open.When there are multiple ways to encode a value, for example rune 0,the shortest encoding is used..PPIn the inverse mapping,any sequence except those described aboveis incorrect and is converted to the Unicode value of hexadecimal 0080..SH "SEE ALSO".IR sys-byte2char (2),.IR "The Unicode Standard" .