Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

返回数据时会出现中文乱码的问题 #2143

Open
SlowVersion opened this issue Aug 30, 2024 · 1 comment
Open

返回数据时会出现中文乱码的问题 #2143

SlowVersion opened this issue Aug 30, 2024 · 1 comment

Comments

@SlowVersion
Copy link

4
5
message返回的数据会出现乱码的情况,我已经将配置中的字符集改为了Unicode。尝试过将高级保存选项中选择Unicode(UTF-8带签名)-代码页65001,返回的乱码没啥变化,高级保存选项中选择Unicode(UTF-8无签名)-代码页65001,返回的为中文,但对于包含中文的字符串的长度必须为双数,长度为单数时,会报的c++常量中有换行符的错误,尝试使用空格补齐,但个别中文会出现错误。
1
2
3

@Kanerudaisuki
Copy link

Kanerudaisuki commented Sep 27, 2024

  1. visual studio 安装英文语言包
  2. 下载一个( 强制将源代码文件保存为utf-8(带签名))的插件
  3. 在C/C++编译选项中加上 “/utf-8”
  4. 项目配置 高级 字符集:使用多字节字符集

PS:在windows上,unicode != utf-8

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants