X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=daklib%2Ftextutils.py;fp=daklib%2Ftextutils.py;h=c9cc4ed380e7a6885b109b154b45893d5c046acc;hb=d6c4dd4efc573cdb2ccdbd8b0915bc4b0b95681a;hp=03df5d8590657c9273b5eb1e7fac05db2a0ce19c;hpb=52fa1e62feb3beccdded038bf6a2857ff3154c48;p=dak.git diff --git a/daklib/textutils.py b/daklib/textutils.py index 03df5d85..c9cc4ed3 100644 --- a/daklib/textutils.py +++ b/daklib/textutils.py @@ -34,6 +34,8 @@ def force_to_utf8(s): Forces a string to UTF-8. If the string isn't already UTF-8, it's assumed to be ISO-8859-1. """ + if isinstance(s, unicode): + return s try: unicode(s, 'utf-8') return s