问题描述
最近,我从Visual Studio切换到Eclipse CDT。我已经精心设置它,使得G ++编译器从我的Cygwin安装可以找到和编译我的代码,没有什么。
然而,有一个小的不满。每次G ++报告警告或错误时,卷曲单引号'
和'
显示为 〜
。这似乎是一个字符编码问题; G ++或Cygwin吐出一个字符编码,CDT或Eclipse不喜欢。
Cygwin显示正确的符号(忽略致命错误):
是的,你必须让Eclipse显示UTF-8,或者停止Cygwin gcc使用它。我不知道如何做前者,但你可以通过确保gcc运行类似LANG = en_US.ISO-8859-1。通过后者,
Recently, I switched from Visual Studio to Eclipse CDT. I've set it up beautifully such that the G++ compiler from my Cygwin installation can locate and compile my code without ado.
There is a minor grievance, however. Each time G++ reports a warning or error, the curly single quotes ‘
and ’
appear as ‘
respectively ’
. It seems like a character encoding problem; G++ or Cygwin is spitting out a character encoding that either CDT or Eclipse doesn't like.
This is only relevant Google result I could find, but setting the C++ environment variable LANG
in Eclipse's preferences to C.UTF-8
or en_US.UTF-8
has no effect.
Running C++ from Cygwin directly reveals the curly single quotes. Is there any way of disabling these altogether? Is there some environment variable I can set or an argument I can pass?
In images
Eclipse shows hieroglyphs in various places:
Cygwin shows the correct symbols (ignore the fatal error):
Yep, you either have to get Eclipse to display UTF-8, or to stop Cygwin gcc from using it. I don't know how to do the former, but you can do the latter by making sure that gcc is run with something like LANG=en_US.ISO-8859-1.
这篇关于g ++卷曲报价在控制台中显示不正确,并且“问题”列表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!