кодировки на андроиде
parent
0e541e9a68
commit
0f5c8de27b
|
@ -1,5 +1,5 @@
|
||||||
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
||||||
<addon id="script.module.pyrrent2http" name="pyrrent2http" version="0.9.2" provider-name="inpos">
|
<addon id="script.module.pyrrent2http" name="pyrrent2http" version="0.9.3" provider-name="inpos">
|
||||||
<requires>
|
<requires>
|
||||||
<import addon="xbmc.python" version="2.14.0"/>
|
<import addon="xbmc.python" version="2.14.0"/>
|
||||||
<import addon="script.module.libtorrent" />
|
<import addon="script.module.libtorrent" />
|
||||||
|
|
|
@ -49,14 +49,14 @@ def unicode_msg(tmpl, args):
|
||||||
return msg % tuple(arg_)
|
return msg % tuple(arg_)
|
||||||
|
|
||||||
def encode_msg(msg):
|
def encode_msg(msg):
|
||||||
msg = isinstance(msg, unicode) and msg.encode(True and sys.getfilesystemencoding() or 'utf-8') or msg
|
msg = isinstance(msg, unicode) and msg.encode(sys.getfilesystemencoding() != 'ascii' and sys.getfilesystemencoding() or 'utf-8') or msg
|
||||||
return msg
|
return msg
|
||||||
|
|
||||||
|
|
||||||
def localize_path(path):
|
def localize_path(path):
|
||||||
if not isinstance(path, unicode): path = path.decode(chardet.detect(path)['encoding'])
|
if not isinstance(path, unicode): path = path.decode(chardet.detect(path)['encoding'])
|
||||||
if not sys.platform.startswith('win'):
|
if not sys.platform.startswith('win'):
|
||||||
path = path.encode(True and sys.getfilesystemencoding() or 'utf-8')
|
path = path.encode(sys.getfilesystemencoding() != 'ascii' and sys.getfilesystemencoding() or 'utf-8')
|
||||||
return path
|
return path
|
||||||
|
|
||||||
def can_bind(host, port):
|
def can_bind(host, port):
|
||||||
|
|
Loading…
Reference in New Issue