mirror of
https://github.com/rembo10/headphones.git
synced 2026-03-26 06:39:26 +00:00
Initial python3 changes
Mostly just updating libraries, removing string encoding/decoding, fixing some edge cases. No new functionality was added in this commit.
This commit is contained in:
@@ -4,7 +4,7 @@
|
||||
|
||||
Example usage:
|
||||
>>> from unidecode import unidecode:
|
||||
>>> unidecode(u"\u5317\u4EB0")
|
||||
>>> unidecode(u"\\u5317\\u4EB0")
|
||||
"Bei Jing "
|
||||
|
||||
The transliteration uses a straightforward map, and doesn't have alternatives
|
||||
@@ -22,11 +22,11 @@ Cache = {}
|
||||
def unidecode(string):
|
||||
"""Transliterate an Unicode object into an ASCII string
|
||||
|
||||
>>> unidecode(u"\u5317\u4EB0")
|
||||
>>> unidecode(u"\\u5317\\u4EB0")
|
||||
"Bei Jing "
|
||||
"""
|
||||
|
||||
if version_info[0] < 3 and not isinstance(string, unicode):
|
||||
if version_info[0] < 3 and not isinstance(string, str):
|
||||
warnings.warn( "Argument %r is not an unicode object. "
|
||||
"Passing an encoded string will likely have "
|
||||
"unexpected results." % (type(string),),
|
||||
|
||||
Reference in New Issue
Block a user