我想使用hg showconfig
获取Mercurial存储库的根路径,然后检索bundle.mainreporoot
。根路径有非ASCII字符,它是D:\maçã\asd
。在
hg showconfig
的输出是:
...
bundle.mainreporoot=D:\maþÒ\asd
...
我在一个编码为cp850的windows7powershell中运行这个。我想告诉Mercurial用正确的编码cp850输出showconfig。我试过例如hg showconfig --encoding cp850
,但没有成功。在
字符þ
在cp850 \xE7
中,它看起来像是ç
的unicode代码点U+00E7(我需要的正确字符),也是cp1252中的ç
。在
在运行命令之前更改代码页有帮助。美国Windows使用cp437作为控制台,Windows-1252用于非Unicode GUI程序。不管出于什么原因,Mercurial正在使用cp1252。如果您不使用我们的Windows,您可能需要一个不同的代码页。在
编辑
根据Python3,您看到的三个不同的字符串是Mercurial返回的cp1252,并在控制台中解码为cp850或cp437:
^{pr2}$您的pastebin代码是cp850解码为cp1252:
相关问题 更多 >
编程相关推荐