diff options
Diffstat (limited to 'Source/Kernel/Library/WChar.class.h')
-rw-r--r-- | Source/Kernel/Library/WChar.class.h | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/Source/Kernel/Library/WChar.class.h b/Source/Kernel/Library/WChar.class.h index 9ddccd1..fc00577 100644 --- a/Source/Kernel/Library/WChar.class.h +++ b/Source/Kernel/Library/WChar.class.h @@ -3,20 +3,32 @@ #include <Core/common.wtf.h> +enum { + UE_UTF8, + UE_UTF16, + UE_UTF32, +}; + +union uchar_repr_t { + char c[4]; + u32int i; +}; + struct WChar { u32int value; - static WChar CP437[]; + static WChar CP437[]; //Codepage 437, used for conversion from/to ascii WChar(); //Creates a null character WChar(char c); //From ascii character - WChar(const char* c); //From utf8 string + WChar(const char* c, u8int encoding = UE_UTF8); //From utf8 string - static u32int utf8len(const char* c); //Returns count of utf8 characters in string + static u32int utfLen(const char* c, u8int encoding = UE_UTF8); //Returns count of utf8 characters in string void affectAscii(char c); u32int affectUtf8(const char* c); void affectUtf16(const char* c); void affectUtf32(const char* c); + u8int toAscii(); inline WChar operator+ (u32int other) { |