Skip to content
This repository has been archived by the owner on Feb 20, 2021. It is now read-only.

Commit

Permalink
fix GeoNames encoding (issue #27)
Browse files Browse the repository at this point in the history
  • Loading branch information
emka committed Aug 10, 2011
1 parent b5b9c21 commit 9c38254
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion api/0.1/addPOIexec
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ def main():
if dom.getElementsByTagName('name'):
name = dom.getElementsByTagName('name')[0].firstChild.data
country = dom.getElementsByTagName('countryCode')[0].firstChild.data
values["nearbyplace"] = "%s [%s]" % (name, country)
values["nearbyplace"] = "%s [%s]" % (name.encode("utf-8"), country.encode("utf-8"))


conn = MySQLdb.connect(db_config.host, user=db_config.user, passwd=db_config.password, db=db_config.dbname)
Expand Down
2 changes: 1 addition & 1 deletion api/0.1/getRSSfeed
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ def main():

pubDate = c[5].strftime("%a, %d %b %Y %H:%M:%S GMT")
desc = c[3].replace("<hr />"," | ")
print "<item><title>%s (near %s)</title><description>%s</description><link>%s?lat=%s&amp;lon=%s&amp;zoom=18</link><guid>%srssitem?id=%s</guid><pubDate>%s</pubDate><geo:lat>%s</geo:lat><geo:long>%s</geo:long></item>" % (type, c[6], desc, server_uri, c[2], c[1], api_uri, c[0], pubDate, c[2], c[1])
print "<item><title>%s (near %s)</title><description>%s</description><link>%s?lat=%s&amp;lon=%s&amp;zoom=18</link><guid>%srssitem?id=%s</guid><pubDate>%s</pubDate><geo:lat>%s</geo:lat><geo:long>%s</geo:long></item>" % (type, c[6].encode("utf-8"), desc, server_uri, c[2], c[1], api_uri, c[0], pubDate, c[2], c[1])
print "</channel></rss>"

main()

0 comments on commit 9c38254

Please sign in to comment.