sys.path和unicode文件夹名称 [英] sys.path and unicode folder names

查看:76
本文介绍了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文件夹名称的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆