JavaMe MIDP, reading UTF-8 encoded http response

Posted by

Working with Icelandic character set, really opens up interesting problems from time to time.  

Working with REST API against my midp Golf80 score registration client  – returning UTF-8 strings, and me now really in shape programming Java  … I took the looooong route to finding an answer to how can I read the Http response as UTF-8 (instead of the default ISO-8859-1) … looking for the stream answers and lots of complicated stuff …. the solution was kinda dissappointing 🙂 

 return new String(message.getBytes(), “UTF-8”);

Just build a new string from the bytes and specify the desired encoding …  back to the Lakers-Heat game live 🙂

One comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s