【发布时间】:2014-11-27 15:07:13
【问题描述】:
我只是从 SourceForge 下载 Astyle。当我在 /bin 中执行 Astyle.exe 时,它说 无法转换为多字节字符串,正在恢复为英文。
我不知道发生了什么。
我发现有a similar question,但那是关于 OS X 中的 Astyle。
这里是与错误相关的源代码。我不知道第二行的意思。
// Not all compilers support the C++ function locale::global(locale(""));
// For testing on Windows change the "Region and Language" settings or use AppLocale.
// For testing on Linux change the LANG environment variable: LANG=fr_FR.UTF-8.
// setlocale() will use the LANG environment variable on Linux.
char* localeName = setlocale(LC_ALL, "");
if (localeName == NULL) // use the english (ascii) defaults
{
fprintf(stderr, "\n%s\n\n", "Cannot set native locale, reverting to English");
setTranslationClass();
return;
}
最后,请随时纠正我的英文。
【问题讨论】: