X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=daklib%2Ftextutils.py;h=c9cc4ed380e7a6885b109b154b45893d5c046acc;hb=0d21dd1feacf8ab3a0cb03abeac7a062096851c6;hp=03df5d8590657c9273b5eb1e7fac05db2a0ce19c;hpb=1c2f5f4048b36efb345a3aa96b20d60dc7af1990;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