tapestry-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Howard M. Lewis Ship (Commented) (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (TAP5-1741) Parsing template which contains Chinese (Maybe other double bytes) words throws MalformedByteSequenceException: Invalid byte 3 of 3-byte UTF-8 sequence.
Date Thu, 03 Nov 2011 15:53:33 GMT

    [ https://issues.apache.org/jira/browse/TAP5-1741?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13143254#comment-13143254
] 

Howard M. Lewis Ship commented on TAP5-1741:
--------------------------------------------

I've written the following test around your sample template, and it passes on my machine:

    @Test
    public void utf8_template() throws Exception {
        List<TemplateToken> tokens = tokens("chinese_utf-8.tml");

        TextToken token7 = get(tokens, 7);

        assertEquals(token7.text.trim().substring(0, 3), "\u975E\u5e38\u7b80");
    }

What is your environment?  This might be a windows vs. mac line endings thing ... or I'm seeing
some issues on the mailing list about Tomcat (what else) causing some problems.
                
> Parsing template which contains Chinese (Maybe other double bytes) words throws MalformedByteSequenceException:
Invalid byte 3 of 3-byte UTF-8 sequence.
> --------------------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: TAP5-1741
>                 URL: https://issues.apache.org/jira/browse/TAP5-1741
>             Project: Tapestry 5
>          Issue Type: Bug
>          Components: tapestry-core
>    Affects Versions: 5.3
>            Reporter: DH
>            Priority: Blocker
>         Attachments: Index.tml
>
>
> After upgrading to 5.3-rc-1, all my templates are not parsed successfully. The error
message points to the line where there are Chinese words.
> Stack Trace below:
> Caused by: com.sun.org.apache.xerces.internal.impl.io.MalformedByteSequenceException:
Invalid byte 3 of 3-byte UTF-8 sequence.
>         at com.sun.org.apache.xerces.internal.impl.io.UTF8Reader.invalidByte(UTF8Reader.java:684)
>         at com.sun.org.apache.xerces.internal.impl.io.UTF8Reader.read(UTF8Reader.java:432)
>         at com.sun.org.apache.xerces.internal.impl.XMLEntityScanner.load(XMLEntityScanner.java:1742)
>         at com.sun.org.apache.xerces.internal.impl.XMLEntityScanner.skipChar(XMLEntityScanner.java:1416)
>         at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2792)
>         at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:648)
>         at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(XMLNSDocumentScannerImpl.java:140)
>         at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:511)
>         at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:808)
>         at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:737)
>         at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:119)
>         at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1205)
>         at org.apache.tapestry5.internal.services.XMLTokenStream.parse(XMLTokenStream.java:306)
>         at org.apache.tapestry5.internal.services.SaxTemplateParser.parse(SaxTemplateParser.java:163)
>         ... 85 more

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Mime
View raw message