12345678910111213141516171819202122232425262728293031 |
- #ifndef TOOLKIT_CHARACHER_SET_H__
- #define TOOLKIT_CHARACHER_SET_H__
- #pragma once
- #include "config.h"
- #ifdef __cplusplus
- extern "C" {
- #endif
- typedef
- enum char_encoding_enu {
- unknown, ansi, unicode, unicode_with_big_endian, unicode_with_bom, unicode_without_bom
- } char_encoding;
- TOOLKIT_API int toolkit_utf82gbk(char* inbuf, size_t inlen, char* outbuf, size_t outlen);
- TOOLKIT_API int toolkit_gbk2utf8(char* inbuf, size_t inlen, char* outbuf, size_t outlen);
- /*0: not-utf8, 1: utf-8: -1: analyze failed*/
- TOOLKIT_API int toolkit_detect_utf8_file(const char* file_path);
- //test now
- TOOLKIT_API char_encoding detect_file_encoding(const char* file_path);
- TOOLKIT_API int toolkit_detect_utf8_str(const char* str);
- #ifdef __cplusplus
- } // extern "C" {
- #endif
- #endif //TOOLKIT_CHARACHER_SET_H__
|