@command(name='diagnostics', usage='print helpful information for diagnostics')
def lx_diagnostics(args):
 print 'default_encoding ->', default_encoding
 import sys
 print 'sys.getdefaultencoding() ->', sys.getdefaultencoding()
 print 'sys.getfilesystemencoding() ->', sys.getfilesystemencoding()
 print "print u'\\u4e2d\\u6587'.encode('utf-8') ->", u'\u4e2d\u6587'.encode('utf-8')
 print "print u'\\u4e2d\\u6587'.encode('gbk') ->", u'\u4e2d\u6587'.encode('gbk')

@ command ( name = 'diagnostics' , usage = 'print helpful information for diagnostics' ) def lx_diagnostics ( args ) : print 'default_encoding ->' , default_encoding import sys print 'sys.getdefaultencoding() ->' , sys . getdefaultencoding ( ) print 'sys.getfilesystemencoding() ->' , sys . getfilesystemencoding ( ) print "print u'\\u4e2d\\u6587'.encode('utf-8') ->" , u'\u4e2d\u6587' . encode ( 'utf-8' ) print "print u'\\u4e2d\\u6587'.encode('gbk') ->" , u'\u4e2d\u6587' . encode ( 'gbk' )
usage: lx diagnostics .