diff options
author | Nicholas Noll <nbnoll@eml.cc> | 2021-10-26 21:32:55 -0700 |
---|---|---|
committer | Nicholas Noll <nbnoll@eml.cc> | 2021-10-26 21:51:49 -0700 |
commit | 189b9e23edfe60b7e82c4c7b6071a3f98799653a (patch) | |
tree | 77c1f32726446deb298a0d2e6389358bfe16bd32 /sys/libunicode/internal.h | |
parent | 29b56ef4e4113bcd091b19d6926f18814162ca53 (diff) |
fix(unicode): renamed functions to be easier to understand their functions
Diffstat (limited to 'sys/libunicode/internal.h')
-rw-r--r-- | sys/libunicode/internal.h | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/sys/libunicode/internal.h b/sys/libunicode/internal.h index bf376b2..31ed2ae 100644 --- a/sys/libunicode/internal.h +++ b/sys/libunicode/internal.h @@ -4,8 +4,18 @@ #include <base.h> #include <libunicode.h> +/* UTF-8 code + * 1 byte: + * 0xxxxxxx + * 2 byte: + * 110xxxxx 10xxxxxx + * 3 byte: + * 1110xxxx 10xxxxxx 10xxxxxx + * 4 byte: + * 11110xxx 10xxxxxx 10xxxxxx 10xxxxxx + */ #define Bit(i) (7-(i)) -/* N 0's preceded by i 1's e.g. T(Bit(2)) is 1100 0000 */ +/* 0's preceded by i 1's e.g. T(Bit(2)) is 1100 0000 */ #define Tbyte(i) (((1 << (Bit(i)+1))-1) ^ 0xFF) /* 0000 0000 0000 0111 1111 1111 */ #define RuneX(i) ((1 << (Bit(i) + ((i)-1)*Bitx))-1) |