jeddawson / geodatastore

Automatically exported from code.google.com/p/geodatastore
0 stars 0 forks source link

Taiwanese characters cause unicode error in quote function #12

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Add a point with description: 羅斯福路四段1號Taiwan ROC
2. Try to query the database.
3. The following error results:
Traceback (most recent call last):
  File
"/base/python_lib/versions/1/google/appengine/ext/webapp/__init__.py", line
499, in __call__
    handler.get(*groups)
  File "/base/data/home/apps/geodatastore/1.37/geoserv.py", line 153, in get
    self.operationPicker()
  File "/base/data/home/apps/geodatastore/1.37/geoserv.py", line 165, in
operationPicker
    out,contentType = self.getGeometries()
  File "/base/data/home/apps/geodatastore/1.37/geoserv.py", line 200, in
getGeometries
    outputAction = {'json': jsonOutput(geometries,'get'),'kml':
kmlOutput(geometries,bboxWest,bboxSouth,bboxEast,bboxNorth)}
  File "/base/data/home/apps/geodatastore/1.37/geoserv.py", line 57, in
jsonOutput
    points.append("{key: '%s', userId: '%s', name: '%s', type: '%s',
description: '%s', timeStamp: '%s', coordinates: %s, altitudes: %s, bbox:
%s}" % (geometry.key(), geometry.userId, quote(geometry.name,'
'),geometry.type, quote(geometry.description,' '),geometry.timeStamp,
coordinates, altitudes,bbox))
  File "/base/python_dist/lib/python2.5/urllib.py", line 1205, in quote
    res = map(safe_map.__getitem__, s)
KeyError: u'\u7f85'

The quote function doesn't seem to like unicode characters.

Original issue reported on code.google.com by pamela.fox on 25 Aug 2008 at 9:55

GoogleCodeExporter commented 9 years ago
Fixed in r28 by encoding things in UTF-8. This fixes the python error, but 
shows the 
characters kind of funny. Not sure what best solution is for showing characters.

Original comment by pamela.fox on 24 Oct 2008 at 7:44