adamwg/tracks-android — Issue #17: Tracks for Android doesn't handle special characters
Author: b-abadie
Created: 2012-02-13 22:15:49+00:00
State: open

Hi,
It appears that Tracks expect UTF8 when parsing data from Tracks for Android.
If I send a note containing accents like "Améliorer la sécurité", Tracks web UI only displays the letters before the first accent, ie : "Am".
If the first accent is in the title, the body isn't recorded in database. If it is in the body, only the part before is recorded in DB.

When viewing at log file from Tracks (apppath/log/production.log), the data sent is effectively latin1 (ISO-8859-1) or similar charset.
I tried to store the database as latin1 : data gets inserted into mysql, but it causes endlesses problems as Tracks is configured to render UTF-8 pages (HTTP server config, html pages encoding, etc.)...

The solution would be to force Tracks for Android to send UTF-8 data.
My researches showed that UTF-8 is already the default encoding on Android platform. The object StringEntity seams to be guilty here, as http://hc.apache.org/httpcomponents-core-ga/httpcore/apidocs/org/apache/http/entity/StringEntity.html says the default encoding is ISO-8859-1.
StringEntity provides a second constructor for wich we can specify the charset. Could it work ? I don't have an Android Dev environnement set up at the moment, so I can't try...

Bests,
Benjamin Abadie