2 Replies Latest reply on Apr 9, 2013 3:23 AM by user12956197

    webview display wrong encoding

      I am embedding baidu map to my application. but Chinese characters of the page can't be properly displayed due to wrong encoding
      for many browser like ie or chrome, user can manully select encoding, how can I do this in webview?
        • 1. Re: webview display wrong encoding
          Currently there's no API for that.
          You may try, with HTTP headers or GET parameters or whatever, to get the server report correct encoding for you.
          • 2. Re: webview display wrong encoding
            this page is encoded by utf-8 <meta charset="utf-8" />
            but when type something in the textbox, it's a ajax recall. http://map.baidu.com/su?wd=ab&cid=131&type=0&newmap=1&b=%2812915600.97,4825427.72;13000720.97,4850323.72%29&t=1365477546776
            which return a json object. it's encoded also by utf-8.
            but I paste this url in firefox or chrome. it's wrongly displayed. I have to manully select utf-8 and it's correct.
            as far as I know, mainstream browser such as ie, ff and chrome have the ability to "detect charset/encoding".
            I guess if the encoding is not specified explicityly, javafx webview will use system's default encoding. I am in windows 7, so it use gbk for Chinese. so it's wrong.