3 Replies Latest reply on May 26, 2008 5:45 AM by murfmee

    French characters not rendering in HTML component

    murfmee Level 1
      I'm unable to get French characters in an .html document to render in the HTML component. For example where the .html code has "é", the HTML component renders "é" in it's place. I have been able to fix this by using "é" in the .html code, but unfortunatly I won't have the freedom to alter the .html code outside of our testing environment.

      I imagine some form of localization is required, but whether that's done with the URLRequest, the HTML component, in the .html code or perhaps with the AIR application's settings is something I've not been able to figure out.
        • 1. Re: French characters not rendering in HTML component
          Oliver Goldman Adobe Employee
          This is most likely a character encoding issue. You need to check what encoding your HTML is using, what encoding it's declaring, and what encoding is being used when it's rendered. All three need to agree in order to get the expected results.

          Oliver Goldman | Adobe AIR Engineering

          • 2. Re: French characters not rendering in HTML component
            murfmee Level 1
            After some further testing I've found that if I set the HTML component's location to the web page's url, it does render the French characters properly. However if I load the page's source code as a text file and then set the HTML component's htmlText property with that string of code, it doesn't render the French characters.

            Due to the nature of the app I'm building I need to load the page, perform some processing on it, and then have the HTML component render it, which I've been doing via htmlText.

            I've tried setting the component's htmlLoader's textEncodingOverride so that it should render the French character set ("ISO-8859-1"), but that causes a throwJSObjectDead error which crash the app, when it tries to run a script on the page. Setting the textEncodingFallback has no effect.. the app runs, but doesn't show French characters.

            The only other thing I can think of that could fix this is to load the page as a string, perform the processes that I need to on it, save it to the disk and then set the HTML component's location to that file.

            Any suggestions..?
            • 3. Re: French characters not rendering in HTML component
              murfmee Level 1
              I've done some further testing and have found that the HTML component will correctly render French characters even if the encoding request in the html code is still set to English. eg: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">

              But every attempt I've made to use the htmlText property to render a webpage with French characters has been a failure, and I've tried every method I can think of to inform the application of what language I want it to render.

              That setting the location property is so forgiving and capable and the htmlText property isn't makes me wonder if using the latter might be modifying the html in such a way that the WebKit engine doesn't render it using the same method as when the location is set, or bypassing some step in WebKit's rendering process.

              Any thoughts..? ^_^