1
votes

I've got a problem when using the BrowserComponent in Codenameone: When calling the dropbox authorization URL in the BrowserComponent within the simulator, the page is displayed, but the charset seems wrong:

android charset problem

I cannot read the text displayed in the browser (nonsense text) - but when I copy & paste the text from the browser component to the texteditor, the text is readable. What can I do to make the text readable in the browser component?

Here's the code I use to use the browser component:

Form tmpBrowserForm = new Form(„DropBoxAccess“);
tmpBrowserForm.setLayout(new BoxLayout(BoxLayout.Y_AXIS));
WebBrowser tmpBrowser = new WebBrowser(„https://www.dropbox.com/oauth2/authorize?response_type=code&client_id=xyz“);
tmpBrowserForm.add(tmpBrowser);
1

1 Answers

0
votes

Make sure the encoding for the page in the browser is set correctly, if you load the text to a String and set it using the page methods make sure that you loaded the String with the correct native encoding.

E.g. never use new String(byte[]).