Differences between revisions 2 and 3
Revision 2 as of 2009-11-28 14:49:33
Size: 913
Editor: Elias
Comment: 删除对PageComment2组件的引用
Revision 3 as of 2009-12-25 07:16:01
Size: 913
Editor: localhost
Comment: converted to 1.6 markup
Deletions are marked like this. Additions are marked like this.
Line 4: Line 4:
[[TableOfContents]] <<TableOfContents>>
Line 6: Line 6:
[[Include(ZPyUGnav)]] <<Include(ZPyUGnav)>>
Line 41: Line 41:
创建 by -- ZoomQuiet [[[DateTime(2008-05-23T23:54:28Z)]]] 创建 by -- ZoomQuiet [<<DateTime(2008-05-23T23:54:28Z)>>]

获取系统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 [2008-05-23 23:54:28]

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