Return-Path: X-Original-To: apmail-commons-issues-archive@minotaur.apache.org Delivered-To: apmail-commons-issues-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 07888CF97 for ; Fri, 7 Jun 2013 17:58:22 +0000 (UTC) Received: (qmail 15768 invoked by uid 500); 7 Jun 2013 17:58:21 -0000 Delivered-To: apmail-commons-issues-archive@commons.apache.org Received: (qmail 15670 invoked by uid 500); 7 Jun 2013 17:58:21 -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 15608 invoked by uid 99); 7 Jun 2013 17:58:21 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 07 Jun 2013 17:58:21 +0000 Date: Fri, 7 Jun 2013 17:58:21 +0000 (UTC) From: "Martin Barrs (JIRA)" To: issues@commons.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (LANG-898) StringEscapeUtils un/escapexml inconsistant with escaped whitespace MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/LANG-898?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Martin Barrs updated LANG-898: ------------------------------ Component/s: (was: General) > StringEscapeUtils un/escapexml inconsistant with escaped whitespace > ------------------------------------------------------------------- > > Key: LANG-898 > URL: https://issues.apache.org/jira/browse/LANG-898 > Project: Commons Lang > Issue Type: Bug > Components: lang.* > Affects Versions: 3.1 > Environment: Windows 7, Java 7 > Reporter: Martin Barrs > > In an escaped XML string with escaped whitespace, in this case linefeed ( & # 10; ), escapexml and unescapexml treat the linefeed inconsistently. > unescape converts & # 10; to a linefeed, yet escapexml does not convert linefeed back to > I've put spaces between the & and # and 10 in this bug as Jira will interpret it: > & # 10; > Here's code and output... > public static void main(String[] args) { > String escaped = > "<?xml version="1.0" encoding="iso-8859-1"?>& #10 ;<?xml version="1.0" encoding="iso-8859-1"?>"; > System.out.println(escaped); > System.out.println(); > System.out.println(StringEscapeUtils.unescapeXml(escaped)); > System.out.println(); > System.out.println(StringEscapeUtils.escapeXml(StringEscapeUtils > .unescapeXml(escaped))); > } > > Output: > <?xml version="1.0" encoding="iso-8859-1"?> <?xml version="1.0" encoding="iso-8859-1"?> > > > <?xml version="1.0" encoding="iso-8859-1"?> > <?xml version="1.0" encoding="iso-8859-1"?> -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira