]> de.git.xonotic.org Git - xonotic/gmqcc.git/commitdiff
Document what the utf8 table actually is
authorDale Weiler <killfieldengine@gmail.com>
Fri, 11 Oct 2013 02:10:36 +0000 (22:10 -0400)
committerDale Weiler <killfieldengine@gmail.com>
Fri, 11 Oct 2013 02:10:36 +0000 (22:10 -0400)
utf8.c

diff --git a/utf8.c b/utf8.c
index 6089df19038bfa171b2b1c4352e8f1ee58eb3dff..42eaecbec37cfe5c7fb143ec38978051112f6ef4 100644 (file)
--- a/utf8.c
+++ b/utf8.c
  * In this table the transition values are pre-multiplied with 16 to
  * save a shift instruction for every byte, we throw away fillers
  * which makes the table smaller.
+ *
+ * The first section of the table handles bytes with leading C
+ * The second section of the table handles bytes with leading D
+ * The third section of the table handles bytes with leading E
+ * The last section of the table handles bytes with leading F
+ *
+ * The values themselfs in the table are arranged so that when you
+ * left shift them by 6 to shif continuation characters into palce, the
+ * new top bits tell:
+ *
+ *  1 - if you keep going
+ *  2 - the range of valid values for the next byte
  */
 static const uint32_t utf8_tab[] = {
     0xC0000002, 0xC0000003, 0xC0000004, 0xC0000005, 0xC0000006, 0xC0000007,