utf8.h
Upload User: wstnjxml
Upload Date: 2014-04-03
Package Size: 7248k
Code Size: 1k
Category:

Windows CE

Development Platform:

C/C++

  1. #ifndef SHARE__UTF8_H
  2. #define SHARE__UTF8_H
  3. /*
  4.  * Convert a string between UTF-8 and the locale's charset.
  5.  * Invalid bytes are replaced by '#', and characters that are
  6.  * not available in the target encoding are replaced by '?'.
  7.  *
  8.  * If the locale's charset is not set explicitly then it is
  9.  * obtained using nl_langinfo(CODESET), where available, the
  10.  * environment variable CHARSET, or assumed to be US-ASCII.
  11.  *
  12.  * Return value of conversion functions:
  13.  *
  14.  *  -1 : memory allocation failed
  15.  *   0 : data was converted exactly
  16.  *   1 : valid data was converted approximately (using '?')
  17.  *   2 : input was invalid (but still converted, using '#')
  18.  *   3 : unknown encoding (but still converted, using '?')
  19.  */
  20. void convert_set_charset(const char *charset);
  21. int utf8_encode(const char *from, char **to);
  22. int utf8_decode(const char *from, char **to);
  23. #endif