Windows API: ANSI and Wide-Character Strings — Is it UTF8 or ASCII? UTF-16 or UCS-2 LE?

Are those above all correct? Yes, if you don’t assume the existence of characters not encoded in Unicode (for most practical applications, this assumption is fine). Do the Windows “A” functions (like SetWindowTextA) take in ASCII strings? Or “multi-byte strings” (more questions on this below)? They take byte strings (i.e., strings whose code unit is … Read more

What is a “wide character string” in C language?

The exact nature of wide characters is (purposefully) left implementation defined. When they first invented the concept of wchar_t, ISO 10646 and Unicode were still competing with each other (whereas they now, mostly cooperate). Rather than try to decree that an international character would be one or the other (or possibly something else entirely) they … Read more

Why does the Java char primitive take up 2 bytes of memory?

When Java was originally designed, it was anticipated that any Unicode character would fit in 2 bytes (16 bits), so char and Character were designed accordingly. In fact, a Unicode character can now require up to 4 bytes. Thus, UTF-16, the internal Java encoding, requires supplementary characters use 2 code units. Characters in the Basic … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)