---
name: "char2uni"
section: "3x"
platform: "linux"
package: "libafterimage-dev"
version: "2.2.12-18"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/char2uni"
---

# char2uni(3x)

handling on Unicode, UTF-8 and localized 8 bit encodings libAfterImage/CHAR\_SIZE

## NAME

**char2uni** - handling on Unicode, UTF-8 and localized 8 bit encodings libAfterImage/CHAR\_SIZE

## 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.

## SOURCE

/\* 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
