Note that after saving it etc, i can re-load it and display and nothing is 
lost, so I think there is something weird about the browsercomponent on 
ios. 

Ie instead of:

browser.setURL(newHTMLpath); //wont display chinese properly

I can do 

browser.getParent().removeAll();/////            
              f.setLayout(new FlowLayout());
            ///READ I NWHAT WE SAVED SEE IF ITS STILL IN TACT?
            InputStream myinput = 
FileSystemStorage.getInstance().openInputStream(newHTMLpath);      
            String arse = Util.readToString(myinput);
         
           StringTokenizer st = new StringTokenizer(arse," ");
            while (st.hasMoreElements())
            {
                String s =(String) st.nextElement();
                 f.add(new SpanLabel(s));////does display chinese properly
            }
           

On Monday, January 21, 2019 at 8:57:05 PM UTC+8, Gareth Murfin wrote:
>
> I have found many conversations on stackoverflow but none of them worked. 
> I am trying to display chinese in a BrowserComponent on iOS, I build the 
> html as a string then save it to FileSystemStorage, then view it using 
> setUrl, but the result is always garbage when I view it on a 
> BrowserComponent on iOS. 
>
> If I make a form and add a button with this in it displays well but I need 
> to be able to view it in a BrowserComponent since it has links etc. Is 
> there any way to display chinese on a BrowserComponent?
>
> Tried 
> out.write(html.getBytes("UTF-8"));
>  Util.writeUTF(html, new DataOutputStream(out));
>
> and many more solutions, but not been able to  get it to work, it works on 
> Android without any special code. Any ideas?
>

-- 
You received this message because you are subscribed to the Google Groups 
"CodenameOne Discussions" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to codenameone-discussions+unsubscr...@googlegroups.com.
Visit this group at https://groups.google.com/group/codenameone-discussions.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/codenameone-discussions/1ad41688-5d17-4da0-a7fe-9de9859386d2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to