[snowy] Force the encoding of note output to UTF-8



commit fb892899514dbe1a2b2ca41de50fda3ce32f305a
Author: Benoit Garret <benoit garret_gnome gadz org>
Date:   Tue Jul 21 11:34:09 2009 -0400

    Force the encoding of note output to UTF-8
    
    Closes: #587214
    Signed-off-by: Brad Taylor <brad getcoded net>

 notes/views.py |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/notes/views.py b/notes/views.py
index 1cfcb2a..b023c97 100644
--- a/notes/views.py
+++ b/notes/views.py
@@ -63,7 +63,7 @@ def note_detail(request, username, note_id, slug='',
         style = libxslt.parseStylesheetDoc(styledoc)
     
         template = CONTENT_TEMPLATES.get(note.content_version, DEFAULT_CONTENT_TEMPLATE)
-        doc = libxml2.parseDoc(template.replace('%%%CONTENT%%%', note.content))
+        doc = libxml2.parseDoc(template.replace('%%%CONTENT%%%', note.content.encode('UTF-8')))
         result = style.applyStylesheet(doc, None)
 
         # libxml2 doesn't munge encodings, so forcibly decode from UTF-8



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]