MyFaces Tomahawk
  1. MyFaces Tomahawk
  2. TOMAHAWK-45

<t:buffer> does not support East Asia characters using UTF-8 encoding

    Details

    • Type: Bug Bug
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: 1.1.3
    • Fix Version/s: None
    • Component/s: Buffer
    • Labels:
      None
    • Environment:
      Windows XP, JBoss 4.0.3SP1

      Description

      East Asia characters support using UTF-8 encoding (request and response). When rendering into a <t:buffer>, some data conversion corrupts the encoding.

      -------

      It was <t:buffer> that caused the encoding problem. I used <t:buffer> in my code.

      I tried the following simple example without <t:buffer>, it worked fine without problem in typing/displaying back East asia characters. If I wrap the code with <t:buffer>, and output the buffer, it will not work, displaying East Asia characters back as question marks.

      I thought <t:buffer> is just a piece of memory without any character conversion. How does <t:buffer> work exactly? what OutputStream is being used? is it possibly involving data conversion? If yes, is there any workaround?

      Thanks!

      -----------without <t:buffer>, works!---

      <%@ page contentType="text/html; charset=UTF-8"%>
      <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
      <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
      <%@ taglib uri="http://myfaces.apache.org/tomahawk" prefix="t"%>
      <HTML>
      <head>
      </head>
      <f:view>
      <h:outputText value="#

      {testBean.name}" />
      <h:form>
      <h:inputText value="#{testBean.name}

      "/>
      <h:commandButton value="Submit" />
      </h:form>
      </f:view>
      </HTML>

      ------------------------------------use <t:buffer>, does not work ----

      <%@ page contentType="text/html; charset=UTF-8"%>
      <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
      <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
      <%@ taglib uri="http://myfaces.apache.org/tomahawk" prefix="t"%>
      <HTML>
      <head>
      </head>
      <f:view>
      <t:buffer into="#

      {buf}">
      <h:outputText value="#{testBean.name}" />
      <h:form>
      <h:inputText value="#{testBean.name}"/>
      <h:commandButton value="Submit" />
      </h:form>
      </t:buffer>
      <h:outputText value="#{buf}

      " escape="false" />
      </f:view>
      </HTML>

      1. utf8.jsp
        0.8 kB
        Mathias Werlitz

        Activity

        Martin Marinschek made changes -
        Priority Blocker [ 1 ] Major [ 3 ]
        Mathias Werlitz made changes -
        Attachment utf8.jsp [ 12337000 ]
        Mathias Werlitz made changes -
        Affects Version/s 1.1.3 [ 12311951 ]
        Priority Major [ 3 ] Blocker [ 1 ]
        Mike Kienenberger made changes -
        Component/s Buffer [ 12310746 ]
        sean schofield made changes -
        Workflow  MyFaces Workflow [ 12358520 ] MyFaces Workflow2 [ 12360919 ]
        sean schofield made changes -
        Workflow  MyFaces Workflow [ 12356930 ] MyFaces Workflow2 [ 12358520 ]
        sean schofield made changes -
        Workflow MyFaces Workflow2 [ 12356354 ]  MyFaces Workflow [ 12356930 ]
        sean schofield made changes -
        Workflow MyFaces Workflow [ 12354379 ] MyFaces Workflow2 [ 12356354 ]
        sean schofield made changes -
        Workflow MyFaces Workflow2 [ 12349007 ] MyFaces Workflow [ 12354379 ]
        sean schofield made changes -
        Workflow MyFaces Workflow [ 12347534 ] MyFaces Workflow2 [ 12349007 ]
        sean schofield made changes -
        Workflow jira [ 12345488 ] MyFaces Workflow [ 12347534 ]
        sean schofield made changes -
        Component/s Tomahawk [ 12310162 ]
        Key MYFACES-1011 TOMAHAWK-45
        Project MyFaces Core [ 10600 ] MyFaces Tomahawk [ 12310272 ]
        Component/s Other [ 12310767 ]
        Affects Version/s Nightly [ 12310660 ]
        Martin Marinschek made changes -
        Field Original Value New Value
        Priority Blocker [ 1 ] Major [ 3 ]
        Dave created issue -

          People

          • Assignee:
            Unassigned
            Reporter:
            Dave
          • Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:

              Development