From 0cadb4301d18724e7513d7489cb5bebd262c82f1 Mon Sep 17 00:00:00 2001 From: Russ Cox Date: Fri, 11 Sep 2009 17:03:06 -0400 Subject: convert to 4-byte UTF-8 and 32-bit Rune http://codereview.appspot.com/116075 --- include/utf.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'include/utf.h') diff --git a/include/utf.h b/include/utf.h index eb5ea42a..44052f41 100644 --- a/include/utf.h +++ b/include/utf.h @@ -4,14 +4,15 @@ extern "C" { #endif -typedef unsigned short Rune; /* 16 bits */ +typedef unsigned int Rune; /* 32 bits */ enum { - UTFmax = 3, /* maximum bytes per rune */ + UTFmax = 4, /* maximum bytes per rune */ Runesync = 0x80, /* cannot represent part of a UTF sequence (<) */ Runeself = 0x80, /* rune and UTF sequences are the same (<) */ - Runeerror = 0xFFFD /* decoding error in UTF */ + Runeerror = 0xFFFD, /* decoding error in UTF */ + Runemax = 0x10FFFF /* maximum rune value */ }; /* Edit .+1,/^$/ | cfn $PLAN9/src/lib9/utf/?*.c | grep -v static |grep -v __ */ -- cgit v1.2.3