00001 // -*- c++ -*- 00002 // = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 00003 00004 // O S C L _ U T F 8 C O N V 00005 00006 // = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 00007 00019 /******************************************************************************** 00020 UTF-8 Bit Distribution 00021 00022 UTF-16 1st Byte 2nd Byte 3rd Byte 4th Byte 00023 -------- -------- -------- -------- -------- -------- -------- -------- 00024 00000000 0xxxxxxx 0xxxxxxx 00025 00000yyy yyxxxxxx 110yyyyy 10xxxxxx 00026 zzzzyyyy yyxxxxxx 1110zzzz 10yyyyyy 10xxxxxx 00027 110110ww wwzzzzyy 110111yy yyxxxxxx 11110uuu 10uuzzzz 10yyyyyy 10xxxxxx 00028 00029 NOTE: 00030 uuuuu = wwww+1 (to account for addition of 0x10000 as in Section 3.7, Surrogates) 00031 00032 **********************************************************************************/ 00033 00034 00035 #ifndef OSCL_UTF8CONV_H 00036 #define OSCL_UTF8CONV_H 00037 00038 #ifndef OSCL_BASE_INCLUDED_H 00039 #include "oscl_base.h" 00040 #endif 00041 00042 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 00043 // Function prototypes 00065 OSCL_IMPORT_REF int32 oscl_UTF8ToUnicode(const char *input, int32 inLength, oscl_wchar *output, int32 outLength); 00066 00067 00068 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 00069 // Function prototypes 00091 OSCL_IMPORT_REF int32 oscl_UnicodeToUTF8(const oscl_wchar *input, int32 inLength, char *output, int32 outLength); 00092 00093 #endif /* OSCL_UTF8CONV_H */ 00094