From mboxrd@z Thu Jan 1 00:00:00 1970 To: 9fans@9fans.net Subject: Re: [9fans] Bgetrune while(i>runesize) loop From: "Russ Cox" Date: Thu, 10 Jul 2008 16:45:52 -0400 In-Reply-To: <36F38215-C75A-46DD-9287-006878D7A102@mac.com> MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Message-Id: <20080710204411.E49F21E8C69@holo.morphisms.net> Topicbox-Message-UUID: e2890c88-ead3-11e9-9d60-3106f5b1d025 > Would this be because fullrune doesn't check for validity, and if > chartorune fails then the possibility of eating too much comes about? Mostly, yes. The fundamental issue is that, presented with malformed UTF-8, chartorune needs to look at more bytes than the number it returns. Russ