From b39ce5b039cbd2922450e9a597bf6b5ad1ef90ca Mon Sep 17 00:00:00 2001 From: Charles Forsyth Date: Sat, 24 May 2014 14:27:10 +0100 Subject: account for 21-bit unicode (issue 314) --- appl/lib/styx.b | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'appl/lib/styx.b') diff --git a/appl/lib/styx.b b/appl/lib/styx.b index c862c9a1..64549c02 100644 --- a/appl/lib/styx.b +++ b/appl/lib/styx.b @@ -69,13 +69,16 @@ init() utflen(s: string): int { - # the domain is 16-bit unicode only, which is all that Inferno now implements + # the domain is 21-bit unicode n := l := len s; for(i:=0; i 16r7F){ n++; - if(c > 16r7FF) + if(c > 16r7FF){ n++; + if(c > 16rFFFF) + n++; + } } return n; } -- cgit v1.2.3