From issues-return-30898-apmail-commons-issues-archive=commons.apache.org@commons.apache.org Wed Nov 21 14:41:59 2012 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 B8D63D8CE for ; Wed, 21 Nov 2012 14:41:59 +0000 (UTC) Received: (qmail 98026 invoked by uid 500); 21 Nov 2012 14:41:59 -0000 Delivered-To: apmail-commons-issues-archive@commons.apache.org Received: (qmail 97884 invoked by uid 500); 21 Nov 2012 14:41:59 -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 97804 invoked by uid 99); 21 Nov 2012 14:41:58 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 21 Nov 2012 14:41:58 +0000 Date: Wed, 21 Nov 2012 14:41:58 +0000 (UTC) From: "Kazuki Hamasaki (JIRA)" To: issues@commons.apache.org Message-ID: <225472836.12397.1353508918410.JavaMail.jiratomcat@arcas> In-Reply-To: <397229373.12395.1353508918245.JavaMail.jiratomcat@arcas> Subject: [jira] [Updated] (LANG-858) StringEscapeUtils.escapeJava() does not output the escaped surrogate pairs that is Java parsable 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-858?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Kazuki Hamasaki updated LANG-858: --------------------------------- Attachment: JavaUnicodeEscape.patch > StringEscapeUtils.escapeJava() does not output the escaped surrogate pairs that is Java parsable > ------------------------------------------------------------------------------------------------ > > Key: LANG-858 > URL: https://issues.apache.org/jira/browse/LANG-858 > Project: Commons Lang > Issue Type: Bug > Components: lang.*, lang.text.translate.* > Affects Versions: 3.x > Reporter: Kazuki Hamasaki > Priority: Minor > Labels: escaping > Attachments: JavaUnicodeEscape.patch > > > In case of Java and ECMA Script, the style of unicode escape {{'\uxxxxxx'}} cannot be accepted. We need to separate it into high-surrogate and low-surrogate. > For example, you put the surrogate pair > {code:java} > '\uDBFF\uDFFD' > {code} > output must be > {code:java} > "\\uDBFF\\uDFFD" > {code} > However you get > {code:java} > "\\u10FFFD" > {code} > Test case here: > {code:java} > @Test > public void testEscapeSurrogatePairs() throws Exception { > assertEquals("\\uDBFF\\uDFFD", StringEscapeUtils.escapeJava("\uDBFF\uDFFD")); > assertEquals("\\uDBFF\\uDFFD", StringEscapeUtils.escapeEcmaScript("\uDBFF\uDFFD")); > } > {code} > I attached the patch which implements simple solution. > But UnicodeEscaper.java should not be specified for Java, I think. We need to discuss about it. > This issue does not be appeared in unescape method. -- 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