datadavev / DwC_views

Implements viewers for Darwin Core record repositories
1 stars 0 forks source link

Gateway API - Ensure UTF8 (unicode) data sent from SOLR #11

Closed datadavev closed 13 years ago

datadavev commented 13 years ago

This ticket is a reminder that output from SOLR should be showing up as UTF-8 encoded text.

Django does everything in unicode internally, so it may be necessary to ensure all content being read from SOLR is appropriately converted to unicode, and that all outgoing text (e.g. transformed, added to templates, in JSON strings, etc) is appropriately converted to UTF-8.

Should probably have a couple of unit tests to cover this.

coreyo commented 13 years ago

The SOLR client api already has utf-8 encoding specified throughout. As it turns out, the default JSON encoder/decoder objects in python (i.e. json and simplejson) use utf-8 by default. I went ahead and specified "encoder='utf-8'" in all of the encoders, but this is redundant.

We should proceed with some unit tests.

datadavev commented 13 years ago

Added a simple unit test to verify output is encoded as expected and that content is not being doubly encoded by the gateway.

Closing this issue - it appears everything is working as expected.