Cygwin 以希伯来语显示错误消息并显示乱码
我一直在使用 Cygwin 使用 NDK 的 ndk-build 脚本和 Cygwin 的 make 工具构建我的 Android 库。它开始给我带来一堆拉丁非英语字符的错误。将文本复制到 Google 时,它被粘贴为希伯来语(我可以阅读)。有什么办法可以强制它以英文输出错误吗?知道为什么会发生这种情况吗?
I have been using Cygwin to build my Android library using the NDK's ndk-build
script and Cygwin's make
tool. It started giving me errors with a bunch of Latin non-English characters. When copying the text to Google, it was pasted as Hebrew (which I can read). Is there any way to force it to output errors in English? Any idea why this happens?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
检查环境变量以获得正确的区域设置。
LANG
或LC_MESSAGES
可能是原因。将它们设置为英语区域设置(在您的个人资料中也可以在将来的会话中设置)以获取英语错误消息。抱歉,我是 Windows 用户,对 Unix 几乎一无所知,因此您必须在其他地方查找具体信息,但这应该是总体方向。某些程序/库试图通过从键盘布局或用户的区域设置猜测区域设置来变得过于聪明。而且常常忽略这样一个事实:在 Windows 上,区域设置和 UI 语言是两个不同的概念(并且控制台上的不同语言更难正确理解)。
至于为什么消息出现乱码,可能是因为控制台窗口使用了错误的代码页。最简单的解决方法通常是在控制台窗口中使用 TrueType 字体,但在这种情况下,Consolas 和 Lucida Console 都不包含希伯来语字形,因此您只能看到方框。
Check your environment variables for the correct locale.
LANG
orLC_MESSAGES
are probably responsible. Set those to an English locale (in your profile to have that in future sessions as well) to get English error messages. Sorry, I'm a Windows person and know nearly nothing of Unix so you'd have to look up the specifics elsewhere, but this should be the general direction to go.Some programs/libraries try to be overly smart by guessing the locale from the keyboard layout or the user's locale. And oftentimes ignoring the fact that on Windows locale and UI language are two different concepts (and that different languages on the console are even harder to get right).
As for why the messages appear garbled that's likely because the console window uses the wrong code page. The easiest fix is usually to use a TrueType font for the console window, but in this case neither Consolas nor Lucida Console include glyphs for Hebrew, so you'd only see boxes anyway.