Patrick Niedzielski
Patrick Niedzielski

Reputation: 1214

How do I obtain a code point integer from a 1 to 4 byte UTF-8 encoded sequence in Windows?

I am Patrick Niedzielski, a programmer for the Free Software 3D adventure game Humm and Strumm. I'm working on a minimal Unicode character class in C++. I currently have an array of four bytes representing a UTF-8 sequence.

On GNU/Linux, I can just convert to UTF-32 with iconv(), but on Windows, I cannot do this. Is it possible to convert the array to a single code point?

Thanks, Patrick

Upvotes: 1

Views: 2997

Answers (1)

Remy Lebeau
Remy Lebeau

Reputation: 595837

I recently posted C/C++ code for decoding a UTF-8 sequence to UTF-32:

How do I read UTF-8 characters via a pointer?

Validate Unicode String and Escape if Unicode is Invalid (C/C++)

Upvotes: 1

Related Questions