Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 64C38200D5B for ; Wed, 13 Dec 2017 17:47:04 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 6342C160C23; Wed, 13 Dec 2017 16:47:04 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id A9BA3160C0F for ; Wed, 13 Dec 2017 17:47:03 +0100 (CET) Received: (qmail 30631 invoked by uid 500); 13 Dec 2017 16:47:02 -0000 Mailing-List: contact issues-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: issues@commons.apache.org Delivered-To: mailing list issues@commons.apache.org Received: (qmail 30620 invoked by uid 99); 13 Dec 2017 16:47:02 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd1-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 13 Dec 2017 16:47:02 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd1-us-west.apache.org (ASF Mail Server at spamd1-us-west.apache.org) with ESMTP id 600FEC6D22 for ; Wed, 13 Dec 2017 16:47:02 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -99.211 X-Spam-Level: X-Spam-Status: No, score=-99.211 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, SPF_PASS=-0.001, T_RP_MATCHES_RCVD=-0.01, USER_IN_WHITELIST=-100] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id VJP1BwwY1GiC for ; Wed, 13 Dec 2017 16:47:01 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTP id 143E55F1EE for ; Wed, 13 Dec 2017 16:47:01 +0000 (UTC) Received: from jira-lw-us.apache.org (unknown [207.244.88.139]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id 5B7EEE0162 for ; Wed, 13 Dec 2017 16:47:00 +0000 (UTC) Received: from jira-lw-us.apache.org (localhost [127.0.0.1]) by jira-lw-us.apache.org (ASF Mail Server at jira-lw-us.apache.org) with ESMTP id 1512B212FB for ; Wed, 13 Dec 2017 16:47:00 +0000 (UTC) Date: Wed, 13 Dec 2017 16:47:00 +0000 (UTC) From: "luccioman (JIRA)" To: issues@commons.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (IO-557) UnsupportedEncodingException when opening an ISO-8859-1 XML stream with Turkish as the default locale MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Wed, 13 Dec 2017 16:47:04 -0000 [ https://issues.apache.org/jira/browse/IO-557?page=3Dcom.atlassian.jir= a.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=3D16289511= #comment-16289511 ]=20 luccioman commented on IO-557: ------------------------------ Ok, I'll do my best to create a Pull Request in the coming days. > UnsupportedEncodingException when opening an ISO-8859-1 XML stream with T= urkish 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=3Dtr, or o= n 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 XmlStre= amReader constructor on an XML stream with a prolog including the ISO-8859-= 1 charset name in lowercase as its encoding throws a UnsupportedEncodingExc= eption (java.io.UnsupportedEncodingException: =C4=B0SO-8859-1). > Example XML prolog : > This is apparently because the XmlStreamReader class uses String.toUpperC= ase() in its getXmlProlog() function. It should rather use toUpperCase(Loca= le.ROOT) or toUpperCase(Locale.US) as already done in the getContentTypeEnc= oding() function. Otherwise the behaviour can be different depending on the= default locale, as the dotted lower case i becomes a dotted upper case i i= n the Turkish language, which not the case with other languages. -- This message was sent by Atlassian JIRA (v6.4.14#64029)