UCS-2 and UTF-8 conversion
I am writing a pure C/C++ program to convert from UCS-2 to UTF-8 character string. I can not find enough information from Google -- the mapping tables (formula) between UCS-2 and UTF-8.
I want to develop the program through pure bit operations (&, | and shifting), and I do not want to invoking any OS specific APIs.
Any reference samples or the mapping tables (formula) between UCS-2 and UTF-8?
thanks in advance,
Maybe you could look in the source code of ICU (IBM's open source library for Unicode).
Wikipedia has good enough info. I've written Unicode converters with it's help.
BTW why write a converter isn't the free libraries cover that functionality.