src/reportlab/lib/utils.py
changeset 3687 1fead6079288
parent 3668 d8a42e00c079
child 3695 1b0c70ee944f
child 3721 0c93dd8ff567
--- a/src/reportlab/lib/utils.py	Mon Apr 22 17:48:33 2013 +0100
+++ b/src/reportlab/lib/utils.py	Mon Apr 29 11:19:28 2013 +0100
@@ -1190,3 +1190,10 @@
         for k,v in kwds.iteritems():
             setattr(self,k,v)
         return self
+
+def makeFileName(s):
+    '''force filename strings to unicode so python can handle encoding stuff'''
+    assert isinstance(s,basestring),"filename is %r should be str or unicode" % s
+    if isinstance(s,str):
+        s = s.decode('utf8')
+    return s