0

我的问题是关于 C++ 下的编码。当我使用 Python 时,有时我不得不使用这样的编码来满足各种需求:

sys.stdin.encoding
sys.stdout.encoding
sys.stderr.encoding
sys.getfilesystemencoding()
sys.getdefaultencoding()
locale.getdefaultlocale()[0]

现在有一个问题:在 C++ 中是否有一种跨平台的方式来实现类似的东西?我知道我可以看到 Python 的源代码,但可能有一些解决方案对使用 C++ 的人来说很有名,而无需查看 Python 的源代码。我认为对于语言环境,我可以使用#include <locale>or #include <clocale>; 在 Linux 下我也可以使用getenv("LANG")from <cstdlib>。还有别的事吗?

如果有帮助,我有工作ICU图书馆。

4

0 回答 0