From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: Date: Fri, 19 May 2006 17:43:44 -0500 From: quanstro@quanstro.net To: 9fans@cse.psu.edu Subject: Re: [9fans] strangely typed functions in standard library In-Reply-To: <446E4B70.6060901@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Topicbox-Message-UUID: 53144740-ead1-11e9-9d60-3106f5b1d025 while true, this is not the reason for the function signature. this is for type promotion reasons. Rune is still an unsigned short. plan 9 does not support ucs-4. - erik On Fri May 19 17:51:07 CDT 2006, viriketo@gmail.com wrote: > Matt Stewart wrote: > > The following functions are described as accepting a Rune, but instead > > the parameters are of type long. Why? > > > > int runelen(long); > > char *utfrune(char *, long); > > char *utfrrune(char *, long); > > > From History in this wikipedia page (http://en.wikipedia.org/wiki/UTF-32): > > UCS-4 is sufficient to represent all of the Unicode code space, which > has 1114112 (= 2^20+2^16) code points and therefore requires only up to > hexadecimal 10FFFF. Some people consider it wasteful to reserve such a > large code space for mapping a relatively small set of code points, so a > new encoding form, UTF-32, was proposed.