0

I've got a character in my app

stored in my app in Unicode

a6 30

(That's listed as 30A6 in the Katakana Unicode PDF I found on the web) (I'll worry about endian issues later)

In a UTF-8 text file opened in a hex editor it's stored as the multi-byte sequence

E3 82 A6

(which corresponds to this UTF-8 encoding list I found)

Is there an API for converting unicode to UTF8?

I'm working on old Win32 / c code which does not compile with unicode support. I could hook into C++ for STL / Boost support if that helps?

craker
  • 67
  • 9
  • "Is there an API" - what about [ICU](http://site.icu-project.org/)? – Aconcagua Apr 20 '17 at 08:47
  • OK this one's been around before - currently having a look at [this answer](http://stackoverflow.com/questions/6240055/manually-converting-unicode-codepoints-into-utf-8-and-utf-16) – craker Apr 20 '17 at 08:58
  • @ Aconcagua - Looks like ICU doesn't support 32 bit builds, older compilers. Thanks for the link. – craker Apr 20 '17 at 09:10
  • Since this is a Win32 application, you might as well use the Win32 API function WideCharToMultiByte. – Harry Johnston Apr 20 '17 at 10:18
  • @ Harry Johnston - Yes! I think it's a matter of understanding what it is I'm trying to achieve - now I'm getting my head round code pages and UTF - this worked first time, thank you – craker Apr 20 '17 at 11:02

0 Answers0