constance

Scripts for generating (an earlier obsolete version of) my personal web site
git clone https://code.djc.id.au/git/constance/
commit 0e335be21ba713c2fa806d35e19efd273324b2d6
parent da060dac6deb9343afbe6dce452544eaebfa9e59
Author: Dan Callaghan <djc@djc.id.au>
Date:   Tue,  2 Sep 2008 20:05:41 +1000

post_name and guid are URL-encoded UTF8 so we need to decode them separately

Diffstat:
Mtools/export_wp.py | 4++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/tools/export_wp.py b/tools/export_wp.py
@@ -24,8 +24,8 @@ def export(options):
                 guid, post_content = row
         
         # Wordpress stores these URL-encoded
-        post_name = urllib.unquote(post_name)
-        guid = urllib.unquote(guid)
+        post_name = urllib.unquote(str(post_name)).decode('utf8')
+        guid = urllib.unquote(str(guid)).decode('utf8')
 
         subcur = cn.cursor()
         subcur.execute('SELECT wp_terms.name FROM wp_term_relationships '