62 lines
		
	
	
		
			907 B
		
	
	
	
		
			C
		
	
	
	
	
	
			
		
		
	
	
			62 lines
		
	
	
		
			907 B
		
	
	
	
		
			C
		
	
	
	
	
	
| #ifndef CHAR_ENCODE_H__
 | ||
| #define CHAR_ENCODE_H__
 | ||
| 
 | ||
| #include "stm32f4xx.h"
 | ||
| 
 | ||
| 
 | ||
| 
 | ||
| 
 | ||
| 
 | ||
| 
 | ||
| 
 | ||
| 
 | ||
| 
 | ||
| 
 | ||
| 
 | ||
| 
 | ||
| uint8_t *uni2utf8 (const uint8_t *uni_in,uint8_t **utf8_out);
 | ||
| 
 | ||
| 
 | ||
| uint8_t *utf82uni (const uint8_t *uft8_in,uint8_t **uni_out);
 | ||
| 
 | ||
| 
 | ||
| uint8_t *gbk2uni (uint8_t *gbk_in,uint8_t **uni_out);
 | ||
| 
 | ||
| 
 | ||
| //Unicode编码转GBK编码
 | ||
| //高字节在前
 | ||
| uint8_t *uni2gbk (uint8_t *uni_in,uint8_t **gbk_out);
 | ||
| 
 | ||
| 
 | ||
| 
 | ||
| //Unicode转utf-8,
 | ||
| void uni2utf8_str (uint8_t *uni_in,uint8_t *utf8_out);
 | ||
| 
 | ||
| //UTF8转Unicode
 | ||
| void utf82uni_str (uint8_t *uft8_in,uint8_t *uni_out);
 | ||
| 
 | ||
| //GBK转Unicode
 | ||
| void gbk2uni_str (uint8_t *gbk_in,uint8_t *uni_out);
 | ||
| 
 | ||
| //Unicode编码转GBK编码
 | ||
| //高字节在前
 | ||
| void uni2gbk_str (uint8_t *uni_in,uint8_t *gbk_out);
 | ||
| 
 | ||
| //GBK转UTF8
 | ||
| void gbk2utf8_str (uint8_t *gbk_in,uint8_t *utf8_out);
 | ||
| 
 | ||
| //UTF8转GBK
 | ||
| void utf82gbk_str (uint8_t *utf8_in,uint8_t *gbk_out);
 | ||
| 
 | ||
| 
 | ||
| //汉字编码转化测试
 | ||
| //返回值
 | ||
| //0,测试成功,非0失败
 | ||
| int char_encode_test (char *str_input);
 | ||
| 
 | ||
| 
 | ||
| 
 | ||
| 
 | ||
| #endif
 | ||
| 
 |