From 4f5d0a6600a22d32236663c8b23e6757f48b1663 Mon Sep 17 00:00:00 2001 From: Tomaz Solc Date: Wed, 21 Sep 2011 17:54:59 +0200 Subject: Always return a string object on Python 2.x Before this patch, unidecode() returned a unicode object on Python 2.x if the input was a unicode object that contained ASCII characters. Behaviour on Python 3.x remains unchanged. --- unidecode/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'unidecode') diff --git a/unidecode/__init__.py b/unidecode/__init__.py index 1b04539..4a08bf0 100644 --- a/unidecode/__init__.py +++ b/unidecode/__init__.py @@ -28,7 +28,7 @@ def unidecode(string): codepoint = ord(char) if codepoint < 0x80: # Basic ASCII - retval.append(char) + retval.append(str(char)) continue if codepoint > 0xeffff: -- cgit v1.2.1