MTK中文乱码

sky123123 2010-04-12 02:51:16
请问MTK是以什么方式存储文件的,当我创建txt文件并写入数据时出现乱码

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


该怎么解决哦,谢谢咯
...全文
288 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
gongliuzai68 2012-04-13
  • 打赏
  • 举报
回复
txt 文档保存的数据用 ANSI 一种混合编码 和 GB2312 差不多 而不是用ascII 因为中文不能用ascII 你的这种现象建议你用unicode保存txt文档 这样就不会乱码了。
Defonds 2010-05-04
  • 打赏
  • 举报
回复
[Quote=引用 3 楼 bestoml 的回复:]
当然不行啦,中文字不是ANSII,所以用了也不行.建议楼主看看字符集相关的知识
/*****************************************************************************
* FUNCTION
* mmi_chset_convert
* DESCRIPTION
* Convert string between 2 ……
[/Quote]up
sky123123 2010-04-30
  • 打赏
  • 举报
回复
嗯,谢谢O(∩_∩)O~
bestoml 2010-04-29
  • 打赏
  • 举报
回复
当然不行啦,中文字不是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);
sky123123 2010-04-13
  • 打赏
  • 举报
回复
[Quote=引用 1 楼 chenzhp 的回复:]
S8 receStr[32];
U8 stuName[16];
//这个函数可以不

AnsiiToUnicodeString(receStr, stuName);
gui_print_text((UI_string_type)receStr);
[/Quote]

不行的阿 我用过了 还是乱

是在文本里面 乱

查询显示时是不乱的哦
chenzhp 2010-04-12
  • 打赏
  • 举报
回复
S8 receStr[32];
U8 stuName[16];
//这个函数可以不

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

790

社区成员

发帖
与我相关
我的任务
社区描述
移动平台 其他移动相关
社区管理员
  • 移动开发其他问题社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧