Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Proper handling of non-ascii titles

  • Loading branch information...
commit ac480d4b1abfc831800321f62b2851945a362e2c 1 parent e6f06fb
Amit Chakradeo authored October 04, 2011
2  planet/reconstitute.py
@@ -75,7 +75,7 @@ def id(xentry, entry):
75 75
         entry_id = entry.link
76 76
     elif entry.has_key("title") and entry.title:
77 77
         entry_id = (entry.title_detail.base + "/" +
78  
-            md5(entry.title).hexdigest())
  78
+            md5(entry.title.encode('utf-8')).hexdigest())
79 79
     elif entry.has_key("summary") and entry.summary:
80 80
         entry_id = (entry.summary_detail.base + "/" +
81 81
             md5(entry.summary).hexdigest())
10  tests/data/reconstitute/title_nonascii.xml
... ...
@@ -0,0 +1,10 @@
  1
+<!--
  2
+Description:  title value
  3
+Expect:       title_detail.language == 'en-us'
  4
+-->
  5
+
  6
+<feed xmns="http://www.w3.org/2005/Atom">
  7
+  <entry>
  8
+    <title xml:lang="en-us">foo æøå. French: êèé </title>
  9
+  </entry>
  10
+</feed>

0 notes on commit ac480d4

Please sign in to comment.
Something went wrong with that request. Please try again.