sys.path和unicode文件夹名称

编程入门 行业动态 更新时间:2024-10-27 00:23:40
本文介绍了sys.path和unicode文件夹名称的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

您好, 在Windows XP上使用 unicode文件夹名称是否有解决方案或解决sys.path问题? 我需要能够从非ascii名称的文件夹中导入模块。 谢谢, Nir

Hello, Is there a solution or a work around for the sys.path problem with unicode folder names on Windows XP? I need to be able to import modules from a folder with a non-ascii name. Thanks, Nir

推荐答案

Nir ​​Aides写道: Nir Aides wrote: 是否有解决方案或解决sys.path问题与 Windows XP上的unicode文件夹名称? 我需要能够从非ascii名称的文件夹中导入模块。 Is there a solution or a work around for the sys.path problem with unicode folder names on Windows XP? I need to be able to import modules from a folder with a non-ascii name.

如果名称仅限于CP_ACP代码页(即大于ASCII, 小于完整Unicode),则使用mbcs;编码应该可以正常工作。 问候, 马丁

If the name is restricted to the CP_ACP code page (i.e. more than ASCII, less then full Unicode), using the "mbcs" encoding should work fine. Regards, Martin

我不能将名称限制为CP_ACP。 我对Unicode的一般情况感兴趣。 Windows XP是原生的Unicode操作系统。 Martin v.L?wis写道: I can not restrict the name to CP_ACP. I am interested in the general case of Unicode. Windows XP is a native Unicode OS. Martin v. L?wis wrote: Nir ​​Aides写道: Nir Aides wrote: 是否有解决方案或解决Windows XP上的unicode文件夹名称的sys.path问题? 我需要能够从非ascii名称的文件夹中导入模块。 Is there a solution or a work around for the sys.path problem with unicode folder names on Windows XP? I need to be able to import modules from a folder with a non-ascii name.

如果名称仅限于CP_ACP代码页(即超过ASCII,少于完整的Unicode),使用mbcs编码应该可以正常工作。 问候, Martin

If the name is restricted to the CP_ACP code page (i.e. more than ASCII, less then full Unicode), using the "mbcs" encoding should work fine. Regards, Martin

Nir ​​Aides写道: Nir Aides wrote: Windows XP上的unicode文件夹名称是否存在解决方案或解决sys.path问题? 我需要能够从非ascii名称的文件夹中导入模块。 Is there a solution or a work around for the sys.path problem with unicode folder names on Windows XP? I need to be able to import modules from a folder with a non-ascii name.

Martin v.L?wis写道:如果名称仅限于CP_ACP代码页(即超过 ASCII,少于完整的Unicode),使用mbcs编码应该工作好。此致,Martin Martin v. L?wis wrote: If the name is restricted to the CP_ACP code page (i.e. more than ASCII, less then full Unicode), using the "mbcs" encoding should work fine. Regards, Martin

Nir ​​Aides:我不能将名称限制为CP_ACP。我对Unicode的一般情况感兴趣。< Windows XP是一个原生的Unicode操作系统。

Nir Aides: I can not restrict the name to CP_ACP. I am interested in the general case of Unicode. Windows XP is a native Unicode OS.

之前的字符串。改变这将需要大量重写进口 机器。我曾经开始研究补丁,但得到了ZERO反馈,所以 我放弃了。 Thomas

Python internally converts unicode entries on sys.path to strings before using them. Changing that would require a large rewrite of the import machinery. I once started to work on a patch, but got ZERO feedback, so I gave up. Thomas

更多推荐

sys.path和unicode文件夹名称

本文发布于:2023-11-23 21:17:37,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1622887.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:文件夹   名称   sys   path   unicode

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!