If there's a command line version of your app, try printing out the type of the name string you're passing to Reportlab. Or if it's django, add the lines<br><br> strType = type(name)<br> assert 0<br><br>and you'll get the debug page where you can inspect the value of strType.<br><br>If you see <type 'unicode'>, that's bad. You need to pass name.encode('utf-8') into Reportlab.<br><br>If you see <type 'str'>, that might or might not be bad. You can use the chardet library to figure out what encoding that string is in. For example:<br><br>>>> chardet.detect(name)<br><span class="computeroutput">{'encoding': 'latin-1', 'confidence': 0.99}</span><br><br>In this example chardet tells you that the name string variable currently holds a string encoded in latin-1. To convert the string to utf-8, try this:<br><br>>>> name.decode('latin-1').encode('utf-8')<br><br>This takes the name string, converts it from latin-1 to a
unicode string, then converts the unicode string to a normal string encoded in utf-8. <br><br>Reportlab should happily generate the file for you once you give it the utf-8 string.<br><br>- Feihong<br><br>Procrastination Method #3: Solve everybody else's problems instead of your own.<br><br><b><i>Carl Karsten <carl@personnelware.com></i></b> wrote:<blockquote class="replbq" style="border-left: 2px solid rgb(16, 16, 255); margin-left: 5px; padding-left: 5px;"> of course now a unicode problem just hit me.<br><br>i use the django admin to enter Ivan Krstic'<br>and reportlab spits out: http://dev.personnelware.com/carl/a/IvanK1.pdf<br><br>so pretty much 100% python.<br><br>I am told:<br><br> > Make sure that you are using utf-8 and not some other encoding, such as<br> > latin-1.<br><br>But I really don't know what that means, nor do I even know how to debug this.<br><br>Carl K<br>_______________________________________________<br>Chicago mailing
list<br>Chicago@python.org<br>http://mail.python.org/mailman/listinfo/chicago<br></blockquote><br><p> 
<hr size=1>Be a better pen pal.
Text or chat with friends inside Yahoo! Mail. <a href="http://us.rd.yahoo.com/evt=51732/*http://overview.mail.yahoo.com/">See how.</a>