tracks-android icon indicating copy to clipboard operation
tracks-android copied to clipboard

Tracks for Android doesn't handle special characters

Open b-abadie opened this issue 13 years ago • 1 comments

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

b-abadie avatar Feb 13 '12 22:02 b-abadie

Thanks for the report -- I haven't tested with non-Latin charsets at all.

Sounds like your solution should work. I'll try it out when I have some time, and release an update if it solves the problem.

adamwg avatar Feb 16 '12 03:02 adamwg