I'm loading some news stuff into a WebView, but there's weird unicode
stuff or something with some chars (right double quotes, curly single
quotes).  So, instead of a right quote, there's 3 chars of gibberish
that show in the WebView.

This is what I'm doing now to cope:

                html=html.replaceAll("\u2019", "'");
                html=html.replaceAll("\u201D", "\"");
                html=html.replaceAll("\u201C", "\"");
                html=filterWeirdChars(html);


        String filterWeirdChars(String str) {
                String newStr = new String();
                for (int ctr = 0; ctr < str.length(); ctr++) {
                        int myChar = str.charAt(ctr);

                        if (myChar < 128)
                                newStr += str.charAt(ctr);
                }
                return newStr;

        }

Anyone have something better?  That code above is slow as molasses and
kludgy.


-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to