.\" t .\" @(#)char2uni.3 03/24/2024 .TH char2uni 3x "AfterStep v.2.2.12" "Mar 24 2024" "AfterStep X11 window manager" .UC .SH NAME \fBchar2uni\fP\ \- handling on Unicode, UTF-8 and localized 8 bit encodings libAfterImage/CHAR_SIZE .SH NAMECHAR_SIZE \- Convenient macro so we can transparently determine the number of bytes that character spans\&. It assumes UTF\-8 encoding when I18N is enabled\&. .SH SOURCE .in +4n .fi /* size of the UTF\-8 encoded character is based on value of * the first byte : */ #define UTF8_CHAR_SIZE(c) ((((c)&0xC0)==0xC0)? \\ (((c)&0x20)? \\ (((c)&0x10)? \\ (((c)&0x08)? \\ (((c)&0x04)?6:5):4):3):2):1) #ifdef WIN32 #define UNICODE_CHAR_SIZE(c) sizeof(UNICODE_CHAR) #endif #define CHAR_SIZE(c) 1 .fi .in