summaryrefslogtreecommitdiff
path: root/appl
diff options
context:
space:
mode:
authorCharles Forsyth <charles.forsyth@gmail.com>2014-05-24 14:27:10 +0100
committerCharles Forsyth <charles.forsyth@gmail.com>2014-05-24 14:27:10 +0100
commitb39ce5b039cbd2922450e9a597bf6b5ad1ef90ca (patch)
tree9a70cd8f66045fdf3bc856c2b4f07a060ce8b64a /appl
parentfc85c874b585778fe2eae90ab562103b7c8a7b6f (diff)
account for 21-bit unicode (issue 314)
Diffstat (limited to 'appl')
-rw-r--r--appl/lib/styx.b7
1 files changed, 5 insertions, 2 deletions
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<l; i++)
if((c := s[i]) > 16r7F){
n++;
- if(c > 16r7FF)
+ if(c > 16r7FF){
n++;
+ if(c > 16rFFFF)
+ n++;
+ }
}
return n;
}