Differences between revisions 1 and 2
Revision 1 as of 2008-05-23 23:54:28
Size: 980
Editor: ZoomQuiet
Comment:
Revision 2 as of 2009-11-28 14:49:33
Size: 913
Editor: Elias
Comment: 删除对PageComment2组件的引用
Deletions are marked like this. Additions are marked like this.
Line 42: Line 42:
||<^>[[PageComment2]]||<^>[:/PageCommentData:PageCommentData]''||

TableOfContents

Include(ZPyUGnav)

获取系统encodeing

Wensheng <[email protected]>
reply-to        [email protected]
to      python-cn`CPyUG`华蟒用户组 <[email protected]>
date    Sat, May 24, 2008 at 7:51 AM
subject [CPyUG:52309] Re: python 如何取得操作系统的默认的encoding

   1 import locale
   2 locale.getdefaultlocale()

在windows和linux都可以。我用的是英文xp, 但我设的中文locale, 所以得到的是 ('en_US','cp936')

cp936 就是 gbk

另外可用

import win32api
win32api.GetSystemDefaultLCID()

但得到的是Id, 你得有转换表才行。


反馈

创建 by -- ZoomQuiet [DateTime(2008-05-23T23:54:28Z)]

MiscItems/2008-05-23 (last edited 2009-12-25 07:16:01 by localhost)