MCUXpresso IDE中文乱码问题

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

MCUXpresso IDE中文乱码问题

2,006 Views
sxshhly
Contributor I

最近在使用MCUXpresso IDE V11.1.1,将原c文件导入后显示中文乱码,并且用串口发送中文字符时发送的数据也是错误的,e.g.通过串口发送“初始化成功”(0xB3 0xF5 0xCA 0xBC 0xBB 0xAF 0xB3 0xC9 0xB9 0xA6),实际发送为下图中的Databuf,请问需要怎样配置MCUXpresso IDE才能解决类似问题。

1.png

0 Kudos
2 Replies

1,897 Views
jingpan
NXP TechSupport
NXP TechSupport

Hi Lynn,

MCUXpresso里默认是显示和保存UTF-8编码的unicode字符集的中文。但你要的是GB3212或者GBK字符集,目前看起来不支持。在windows->preferences->general->workspace里无法转成GBK。所以你只能在外面把中文先转成hex格式。

在UTF-8中,一个汉字为什么需要三个字节?(转) - quietwalk - 博客园 

https://www.qqxiuzi.cn/bianma/zifuji.php 

Regards,

Jing

0 Kudos

1,895 Views
sxshhly
Contributor I

Hi Jing,

谢谢回复。

我试着在选择字符格式框内手动填入GBK后程序暂时运行正常了。

Best wishes,

Lynn

发件人: jingpan<mailto:admin@community.nxp.com>

发送时间: 2020年6月18日 17:52

收件人: Lynn Huang<mailto:sxshhly@outlook.com>

主题: Re: - Re: MCUXpresso IDE中文乱码问题

NXP Community <https://community.freescale.com/resources/statics/1000/35400-NXP-Community-Email-banner-600x75.jpg>

Re: MCUXpresso IDE中文乱码问题

reply from Jing Pan<https://community.nxp.com/people/jingpan?et=watches.email.thread> in MCUXpresso Software and Tools - View the full discussion<https://community.nxp.com/message/1328613?commentID=1328613&et=watches.email.thread#comment-1328613>

Hi Lynn,

MCUXpresso里默认是显示和保存UTF-8编码的unicode字符集的中文。但你要的是GB3212或者GBK字符集,目前看起来不支持。在windows->preferences->general->workspace里无法转成GBK。所以你只能在外面把中文先转成hex格式。

在UTF-8中,一个汉字为什么需要三个字节?(转) - quietwalk - 博客园<https://community.nxp.com/external-link.jspa?url=https%3A%2F%2Fwww.cnblogs.com%2Fquietwalk%2Fp%2F7680138.html>

https://www.qqxiuzi.cn/bianma/zifuji.php<https://community.nxp.com/external-link.jspa?url=https%3A%2...;

Regards,

Jing

Reply to this message by replying to this email, or go to the message on NXP Community<https://community.nxp.com/message/1328613?commentID=1328613&et=watches.email.thread#comment-1328613>

Start a new discussion in MCUXpresso Software and Tools by email<mailto:discussions-community-mcuxpresso@mail.freescale.jiveon.com> or at NXP Community<https://community.nxp.com/choose-container.jspa?contentType=1&containerType=14&container=11553&et=watches.email.thread>

Following Re: MCUXpresso IDE中文乱码问题<https://community.nxp.com/message/1328613?commentID=1328613&et=watches.email.thread#comment-1328613> in these streams: Inbox

This email was sent by NXP Community because you are a registered user.

You may unsubscribe<https://community.nxp.com/unsubscribe.jspa?id=359361&token=a20777a20f420569af861e65210f80e7058f1361d7eb8268b5aea60863113a13> instantly from NXP Community, or adjust email frequency in your email preferences<https://community.nxp.com/user-preferences!input.jspa>

0 Kudos