[PythonReports-users] Filename
Brought to you by:
a1s
From: Werner F. B. <wer...@fr...> - 2013-04-28 15:04:53
|
Hi, pdfdoc.SaveToFile is using "utf8str" on the file name passed. This changes the file name from: u'C:\\dev\\twcbv4\\data\\generatedReports\\Kellerbuch Liste - Portr\xe4t.pdf' to: 'C:\\dev\\twcbv4\\data\\generatedReports\\Kellerbuch Liste - Portr\xc3\xa4t.pdf' Is this for compatibility with older Python versions? As on Python 2.7.2 Windows 7 I end up with: Kellerbuch Liste - Porträt.pdf instead of: Kellerbuch Liste - Porträt.pdf If I just comment the line 234 in pdfdoc "filename = utf8str(filename)" then all works fine, at least on Py 2.7 Win7 and passing in the unicode value. Do you know why reportlab is changing the file name, shouldn't the caller be responsible to pass in a valid name. I use "get_output_file_name" to get the file name from the user and then pass this to pdf.write as a unicode value, should/can I do something different to prevent this change of the file name. Werner |