Re: encoding for comments
gabor <[email protected]>
| Newsgroups | gmane.comp.web.pyblosxom.user |
|---|---|
| Message-ID | <1084949039.13436.1.camel@dubb> |
On Tue, 2004-05-18 at 17:45 -0400, Michael Davidson wrote: > On Tue, 18 May 2004, gabor ([email protected]) wrote: > > if config.has_key('blog_encoding'): > > encoding = config['blog_encoding'] > > else: > > encoding = 'iso-8859-1' > > cfile.write('<?xml version="1.0" encoding="'+encoding+'"?>\n') > > This won't work as written. You can't just put the encoding in the xml > file; you have to write to the file using the given encoding. You should > try using the string.encode method to do this. you're absolutely right, that the encoding has to be done also for the content of the xml..i forgot about that.. but the problem is more complicated... because the stuff that the comments plugin writer, aren't imho unicode strings... imho they are taken from the POST request the way they are.... so imho if the data in the POST request is in the same encoding as the 'blog_encoding' (is it?), then it's safe to simply do it the way is it for now. am i right? gabor ------------------------------------------------------- This SF.Net email is sponsored by: SourceForge.net Broadband Sign-up now for SourceForge Broadband and get the fastest 6.0/768 connection for only $19.95/mo for the first 3 months! http://ads.osdn.com/?ad_id=2562&alloc_id=6184&op=click