Problen with special chars


#1

Good morning.

I’m having trouble using the Twitter API.

My application works perfectly, I updated the status of the user logged in without any problems.

My problem comes when the text you type is a special character (ñ, á, é, í …)

In this case the message is not sent to twitter.

Why is this happening? How I can fix it?

Thanks and slaudo!

Javier


#2

Use it like this, it’s working for me:
String rawString = “Árvíztűrő tükörfúrógép”;

String encodedText = new String(rawString.getBytes(), “UTF-8”);
entity.addPart(“status”, new StringBody(encodedText, Charset.forName(“UTF-8”)));