读书人

MTK中文乱码,该怎么处理

发布时间: 2012-03-30 17:32:09 作者: rapoo

MTK中文乱码
请问MTK是以什么方式存储文件的,当我创建txt文件并写入数据时出现乱码

而且存储中文数据时正常,而读出中文时,则出现乱码问题?


该怎么解决哦,谢谢咯

[解决办法]
S8 receStr[32];
U8 stuName[16];
//这个函数可以不

AnsiiToUnicodeString(receStr, stuName);
gui_print_text((UI_string_type)receStr);

[解决办法]
当然不行啦,中文字不是ANSII,所以用了也不行.建议楼主看看字符集相关的知识
/*****************************************************************************
* FUNCTION
* mmi_chset_convert
* DESCRIPTION
* Convert string between 2 character sets. (will add the terminate character)
* PARAMETERS
* src_type [IN] Charset type of source
* dest_type [IN] Charset type of destination
* src_buff [IN] Buffer stores source string
* dest_buff [OUT] Buffer stores destination string
* dest_size [IN] Size of destination buffer (bytes)
* RETURNS
* Length of destination string, including null terminator. (bytes)
*****************************************************************************/
kal_int32 mmi_chset_convert(
mmi_chset_enum src_type,
mmi_chset_enum dest_type,
char *src_buff,
char *dest_buff,
kal_int32 dest_size);
使用方式如下:

mmi_chset_convert(MMI_CHSET_GB2312,MMI_CHSET_UCS2,(char * )soure_string,(char *)destion_string,source_size);

读书人网 >移动平台

热点推荐