From mboxrd@z Thu Jan 1 00:00:00 1970 From: erik quanstrom Date: Thu, 30 Jun 2011 09:14:10 -0400 To: 9fans@9fans.net Message-ID: <07ca4941227790da33d892ee4679c023@ladd.quanstro.net> In-Reply-To: <20110630130254.GA7276@polynum.com> References: <20110625171134.GA3661@polynum.com> <20110626075745.GA395@polynum.com> <20110627114856.GA7099@polynum.com> <9308c52f360f6274e0730399741278ce@ladd.quanstro.net> <20110627172006.GA497@polynum.com> <4E08DDDE.94AB.00CC.0@wlu.ca> <20110628111915.GA498@polynum.com> <4E0B804C.94AB.00CC.0@wlu.ca> <20110630130254.GA7276@polynum.com> MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Subject: Re: [9fans] [RFC] fonts and unicode/utf [TeX] Topicbox-Message-UUID: f7f45430-ead6-11e9-9d60-3106f5b1d025 > But, as the present state allows the use for every character set that > fits in eight bits, by using (for Plan9 users) tcs(1) to feed TeX with > what it expects, I will not delay forever the release of 1.0 waiting for > this next solution. good grief. how hard is it to write this code!? this bit depends on just a few simple functions from the plan 9 c library and that can be easily appropriated, namely chartorune and fullrune, and a user-defined getc. (not compiled, just dashed off. just an example of how easy this is.) char texgetutfchar(void) { char ibuf[UTFmax + 1]; int c, utfi; Rune r; for(;;){ if(utfi == sizeof ibuf - 1){ itfi = 0; print("garbage input rejected\n"); } ibuf[utfi++] = getc(); ibuf[utfi] = 0; if(fullrune(ibuf, utfi)){ r = chartorune(&r, ibuf); utfi = 0; if(r >= 256){ print("codepoint %#.6ux rejected", r); continue; } return (char)r; } } } - erik