5 Replies Latest reply on Mar 9, 2009 12:19 PM by nbelaevski

    Invalid byte 2 of 3-byte UTF-8 sequence

    jobb

      Converted RichFaces application from jsf pages to Facelets and xhtml pages. Got Invalid byte 2 of 3-byte UTF-8 sequence on pages using Norwegian character set.
      Sun xerces parser try to parse the page and don't understand UTF-8 chars.

      page starts with :

      <?xml version="1.0" encoding="ISO-8859-1"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" >
      
      and in head section
      <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/>


      Happens the same in RF demo if you change a text using æø
      You can omit this using number representation like
      æ for æ
      but you have to rewrite all pages.



        • 1. Re: Invalid byte 2 of 3-byte UTF-8 sequence
          jobb

          Sorry, but problems with UTF-8 chars concerning also this site. All special chars on this page are transformed to unreadeble labels
          What I tried to show was number chars from http://www.w3schools.com/tags/ref_entities.asp (Entity number) &#230;

          • 2. Re: Invalid byte 2 of 3-byte UTF-8 sequence
            nbelaevski

            Hello,

            Have you tried this:

            <?xml version="1.0" encoding="UTF-8"?>
            ?

            • 3. Re: Invalid byte 2 of 3-byte UTF-8 sequence
              jobb

              Yes, the same problem

              • 4. Re: Invalid byte 2 of 3-byte UTF-8 sequence
                jobb

                I have checked more about extended character set. In addition to norwegian and other languages, characters like   or even expression like

                <h:commandLink rendered="#{orderdetailMBean.orderHasAssets && orderLineWrapper.downloadURL != ''}">

                gives a parsing error (the last one : The entity name must immediately follow the '&' in the entity reference).
                The question is how to setup/parametrize the parser to avoid this?

                One workaround is to use boundle and propeties file with all texts. But what to do with el expressions including && ?

                • 5. Re: Invalid byte 2 of 3-byte UTF-8 sequence
                  nbelaevski

                   

                  "jobb@miroko.net" wrote:
                  I have checked more about extended character set. In addition to norwegian and other languages, characters like   or even expression like
                  <h:commandLink rendered="#{orderdetailMBean.orderHasAssets && orderLineWrapper.downloadURL != ''}">

                  gives a parsing error (the last one : The entity name must immediately follow the '&' in the entity reference).
                  The question is how to setup/parametrize the parser to avoid this?

                  One workaround is to use boundle and propeties file with all texts. But what to do with el expressions including && ?

                  Facelets view file should be a syntactically correct XML file. Use "AND" or
                  &&