You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by "Martin Grigorov (JIRA)" <ji...@apache.org> on 2013/11/15 15:13:22 UTC

[jira] [Resolved] (WICKET-5416) BOM in UTF markup file breaks encoding detection

     [ https://issues.apache.org/jira/browse/WICKET-5416?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Martin Grigorov resolved WICKET-5416.
-------------------------------------

       Resolution: Fixed
    Fix Version/s: 7.0.0
                   6.13.0
                   1.5.11
         Assignee: Martin Grigorov

Thanks!

> BOM in UTF markup file breaks encoding detection
> ------------------------------------------------
>
>                 Key: WICKET-5416
>                 URL: https://issues.apache.org/jira/browse/WICKET-5416
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.5.10, 6.12.0
>         Environment: Windows 7, jdk1.7.0_45
>            Reporter: Vadim Ponomarev
>            Assignee: Martin Grigorov
>             Fix For: 1.5.11, 6.13.0, 7.0.0
>
>
> I have project with internationalization and experienced this problem with one of the pages with non-english content. Page had UTF-8 encoding, but my JVM encoding is different. I always use "<?xml encoding ... ?>" to specify encoding for markup pages (and "MarkupSettings.defaultMarkupEncoding" is not set).
> Unexpectedly I got problem with bad encoding on page. After several hours of debugging I found what source of this issue was UTF BOM (Byte order mark) at the beggining of file and inability of "XmlReader" to process it. "XmlReader.getXmlDeclaration" tries to match xml declaration with regular expression, but fails because of BOM. After that encoding defaults to JVM encoding.
> It's possible to use "org.apache.commons.io.input.BOMInputStream" to handle BOM or you could handle it manually inside "XmlReader".
> PS: issue found with Wicket 1.5.10 and I see same code in 6.12.0 without BOM handling, so I added it to "Affects Version/s", but no proof-in-code available from me at this moment.



--
This message was sent by Atlassian JIRA
(v6.1#6144)