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

ASF GitHub Bot commented on IO-557:
-----------------------------------

GitHub user luccioman opened a pull request:

    https://github.com/apache/commons-io/pull/51

    [IO-557] Perform locale independant upper case conversions.

    To handle properly lower cased character encoding name in XML prolog
    with any default system locale, notably Turkish which has specific rules 
for case conversion of dotted and dotless i characters.
    
    Fixes issue [IO-557](https://issues.apache.org/jira/browse/IO-557).

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/luccioman/commons-io case_conversion

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/commons-io/pull/51.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #51
    
----
commit 9969d9b4fbe25c136031d70734de286a4e08ff7a
Author: luccioman <[email protected]>
Date:   2017-12-18T08:37:06Z

    Perform locale independant upper case conversions.
    
    To handle properly lower cased character encoding name in XML prolog
    with any default system locale, notably Turkish.

----


> UnsupportedEncodingException when opening an ISO-8859-1 XML stream with 
> Turkish as the default locale
> -----------------------------------------------------------------------------------------------------
>
>                 Key: IO-557
>                 URL: https://issues.apache.org/jira/browse/IO-557
>             Project: Commons IO
>          Issue Type: Bug
>          Components: Streams/Writers
>    Affects Versions: 2.6
>         Environment: JVM running with argument -Duser.language=tr, or on an 
> Operating System with Turkish as its preferred language.
>            Reporter: luccioman
>            Priority: Minor
>              Labels: easyfix
>
> When the default locale is set to the Turkish language, using the 
> XmlStreamReader constructor on an XML stream with a prolog including the 
> ISO-8859-1 charset name in lowercase as its encoding throws a 
> UnsupportedEncodingException (java.io.UnsupportedEncodingException: 
> İSO-8859-1).
> Example XML prolog : <?xml version="1.0" encoding="iso-8859-1"?>
> This is apparently because the XmlStreamReader class uses 
> String.toUpperCase() in its getXmlProlog() function. It should rather use 
> toUpperCase(Locale.ROOT) or toUpperCase(Locale.US) as already done in the 
> getContentTypeEncoding() function. Otherwise the behaviour can be different 
> depending on the default locale, as the dotted lower case i becomes a dotted 
> upper case i in the Turkish language, which not the case with other languages.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to