Reputation: 10296
I have an Android app and it allows users to post text. I'm noticing that certain text like 'ó' and other text with the accent above it ends up getting changed to a '?'.
I haven't hand any luck searching Google about this. My android app posts to an API. I've tested the API using other clients such as an iPhone app, a C# app and a web app and none of the other clients have issues with the special characters.
Is there some setting when doing an http post or before the post that I need to change in Android?
Upvotes: 2
Views: 206
Reputation: 161
Thanks for the question which helped me solve my problem :)
The following links also proved useful:
Android : upload Image and JSON using MultiPartEntityBuilder
MultipartEntityBuilder and Charset
Steps that I followed:
Downloaded latest jar httpcore-4.3.jar httpmime-4.3.3.jar (This contains the MultipartEntityBuilder class)
With the latest version of hhtpmime jar you can use the entity.addTextBody(). This helps in posting the text consisting special characters.
Refer these jars in you project.
Upvotes: 0
Reputation: 10296
For me the answer was found here:
Setting encoding for a Multipart Entity
I was using a multipart entity when doing an httppost so all that was needed was to set the encoding to UTF-8 and it seems to work out ok.
Upvotes: 2