MyFaces Core
  1. MyFaces Core
  2. MYFACES-1433

HTML Response encodes Javascript code with numeric character references for non-UTF8 character encoding


    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Won't Fix
    • Affects Version/s: 1.1.3
    • Fix Version/s: None
    • Component/s: General
    • Labels:
    • Environment:
      Windows XP, BEA Weblogic 8.1, JDK 1.4.2, but probably not restricted to this environment.


      [A similar issue was already open under MYFACES-218.]

      We use Ajax4JSF which sends Javascript code embedded in Ajax responses to the server. This Javascript code is used to update client-side state of input components and select components (comboboxes). In the case of comboboxes, the response also contains literal String arrays.

      We use ISO-8859-1 as the output character set, not UTF-8.

      The effect that we notice is the same as stated in MYFACES-218, namely that the Javascript strings are rendered with all non-latin-1 characters replaced by numeric character references. As the Javascript strings are used to update input fields or re-render select options, e.g., a combobox would then contain entries where non-latin-1 characters show up with the character references visible instead of the intended characters.

      In this environment it is no longer easy to go over all the returned strings and use some client-side replacement function, because the client-side code is part of the Ajax4JSF project. Also, implementing some un-escaping functionality on the client side makes the client dependent on particulars of the server-side JSF implementation.

      Also, in my humble opinion, having the character references in Javascript strings is plain wrong, however, this is from my experience and not from looking through standard documents. But the net effect is that the strings are not rendered correctly (as intended) by the browser.



        Claus Schmid created issue -
        Thomas Andraschko made changes -
        Field Original Value New Value
        Resolution Won't Fix [ 2 ]
        Status Open [ 1 ] Closed [ 6 ]


          • Assignee:
            Claus Schmid
          • Votes:
            0 Vote for this issue
            1 Start watching this issue


            • Created: