程序问答   发布时间:2022-06-02  发布网站:大佬教程  code.js-code.com
大佬教程收集整理的这篇文章主要介绍了GCC 4.7字符串文字的源字符编码和执行字符编码?大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。

如何解决GCC 4.7字符串文字的源字符编码和执行字符编码??

开发过程中遇到GCC 4.7字符串文字的源字符编码和执行字符编码?的问题如何解决?下面主要结合日常开发的经验,给出你关于GCC 4.7字符串文字的源字符编码和执行字符编码?的解决方法建议,希望对你解决GCC 4.7字符串文字的源字符编码和执行字符编码?有所启发或帮助;

我不知道这些选项的实际效果如何(不使用atm;我仍然更喜欢将字符串文字视为“仅ASCII”,因为本地化的字符串无论如何都来自外部文件,因此大多是格式字符串或文件名之类的东西),但是它们添加了诸如

-fexec-charset=charset
Set the execution character set, used for String and character constants. The default
is UTF-8. charset can be any enCoding supported by the system's iconv library routIne.

-fwIDe-exec-charset=charset
Set the wIDe execution character set, used for wIDe String and character constants.
The default is UTF-32 or UTF-16, whichever corresponds to the wIDth of wchar_t. As
with -fexec-charset, charset can be any enCoding supported by the system's iconv
library routIne; however, you will have problems with enCodings that do not fit
exactly in wchar_t.

-finput-charset=charset
Set the input character set, used for translation from the character set of the
input file to the source character set used by GCC. If the locale does not specify,
or GCC cAnnot get this information from the locale, the default is UTF-8. This can
be overrIDden by either the locale or this command line option. Currently the command
line option takes precedence if there's a conflict. charset can be any enCoding
supported by the system's iconv library routIne.

解决方法

Linux / x86_64上的GCC 4.7是否具有默认字符编码,通过它可以验证和解码C源文件中字符串文字的内容?这是可配置的吗?

此外,将字符串文字从字符串文字链接到输出的数据部分时,它是否具有默认的执行字符编码?这是可配置的吗?

在任何配置中,源字符编码都可能与执行字符编码不同吗?(那gcc会在字符编码之间进行代码转换吗?)

大佬总结

以上是大佬教程为你收集整理的GCC 4.7字符串文字的源字符编码和执行字符编码?全部内容,希望文章能够帮你解决GCC 4.7字符串文字的源字符编码和执行字符编码?所遇到的程序开发问题。

如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。

本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。