You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commons-dev@ws.apache.org by "Andreas Veithen (JIRA)" <ji...@apache.org> on 2008/05/12 15:45:55 UTC

[jira] Created: (WSCOMMONS-345) AXIOMUtil.stringToOM doesn't work properly

AXIOMUtil.stringToOM doesn't work properly
------------------------------------------

                 Key: WSCOMMONS-345
                 URL: https://issues.apache.org/jira/browse/WSCOMMONS-345
             Project: WS-Commons
          Issue Type: Bug
          Components: AXIOM
            Reporter: Andreas Veithen


The AXIOMUtil.stringToOM(String) utility method doesn't work properly if the XML fragment contains non ASCII characters and the platform default charset is not UTF-8. Indeed, stringToOM relies on String#getBytes() which uses the platform default charset. It then constructs a ByteArrayInputStream to pass the fragment to the parser. However, the parser will use UTF-8 by default. Instead of using a ByteArrayInputStream, stringToOM should use a StringReader.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (WSCOMMONS-345) AXIOMUtil.stringToOM doesn't work properly

Posted by "Andreas Veithen (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/WSCOMMONS-345?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Andreas Veithen resolved WSCOMMONS-345.
---------------------------------------

    Resolution: Fixed

> AXIOMUtil.stringToOM doesn't work properly
> ------------------------------------------
>
>                 Key: WSCOMMONS-345
>                 URL: https://issues.apache.org/jira/browse/WSCOMMONS-345
>             Project: WS-Commons
>          Issue Type: Bug
>          Components: AXIOM
>            Reporter: Andreas Veithen
>         Attachments: WSCOMMONS-345.patch.txt
>
>
> The AXIOMUtil.stringToOM(String) utility method doesn't work properly if the XML fragment contains non ASCII characters and the platform default charset is not UTF-8. Indeed, stringToOM relies on String#getBytes() which uses the platform default charset. It then constructs a ByteArrayInputStream to pass the fragment to the parser. However, the parser will use UTF-8 by default. Instead of using a ByteArrayInputStream, stringToOM should use a StringReader.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (WSCOMMONS-345) AXIOMUtil.stringToOM doesn't work properly

Posted by "Andreas Veithen (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/WSCOMMONS-345?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Andreas Veithen updated WSCOMMONS-345:
--------------------------------------

    Attachment: WSCOMMONS-345.patch.txt

Added a patch that corrects AXIOMUtil.stringToOM and adds a test case.

> AXIOMUtil.stringToOM doesn't work properly
> ------------------------------------------
>
>                 Key: WSCOMMONS-345
>                 URL: https://issues.apache.org/jira/browse/WSCOMMONS-345
>             Project: WS-Commons
>          Issue Type: Bug
>          Components: AXIOM
>            Reporter: Andreas Veithen
>         Attachments: WSCOMMONS-345.patch.txt
>
>
> The AXIOMUtil.stringToOM(String) utility method doesn't work properly if the XML fragment contains non ASCII characters and the platform default charset is not UTF-8. Indeed, stringToOM relies on String#getBytes() which uses the platform default charset. It then constructs a ByteArrayInputStream to pass the fragment to the parser. However, the parser will use UTF-8 by default. Instead of using a ByteArrayInputStream, stringToOM should use a StringReader.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.