Skip to main content

LWUIT HTMLComponent shows question marks on some samsung models

2 replies [Last post]
Joined: 2011-09-26

I'm creating a mobile app using LWUIT. I used HTMLComponent to show help text to user. Note that the help language is Farsi (which uses Arabic letters).
On most handsets it works fine but on others (e.g. Samsung B3410W) it just shows questions marks instead of letters.
I've set HTMLCallback but parsingError is not called at all.
The instruction which sets the html code is this:

[prettify]<span class="pln">helpComponent</span><span class="pun">.</span><span class="pln">setHTML</span><span class="pun">(</span><span class="str">"<html dir=\"rtl\"><body><p align=\"justify\">"</span><span class="pln"> </span><span class="pun">+</span><span class="pln"> body </span><span class="pun">+</span><span class="pln"> </span><span class="str">"</p></body></html>"</span><span class="pun">,</span><span class="pln"> </span><span class="str">"UTF8"</span><span class="pun">,</span><span class="pln"> </span><span class="kwd">null</span><span class="pun">,</span><span class="pln"> </span><span class="kwd">true</span><span class="pun">);</span><span class="pln"><br /></span>[/prettify]

where body is a string read by calling DataInputStream.readUTF() method.

Does any body know what I'm missing?

Thank you

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Joined: 2003-11-07

I'm guessing the font on the device doesn't support the characters in the body assuming they are non-latin characters.

Joined: 2011-09-26

I changed "UTF8" for encoding to "UTF-8" and now the problematic handset is working fine.

In another forum they told me that "UTF-8" is the standard and all models should work with it.