Return-Path: Delivered-To: apmail-commons-issues-archive@locus.apache.org Received: (qmail 70688 invoked from network); 21 Jan 2009 08:33:21 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 21 Jan 2009 08:33:21 -0000 Received: (qmail 74695 invoked by uid 500); 21 Jan 2009 08:33:20 -0000 Delivered-To: apmail-commons-issues-archive@commons.apache.org Received: (qmail 74628 invoked by uid 500); 21 Jan 2009 08:33:20 -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 74617 invoked by uid 99); 21 Jan 2009 08:33:20 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 21 Jan 2009 00:33:20 -0800 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 21 Jan 2009 08:33:19 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 9F630234C48C for ; Wed, 21 Jan 2009 00:32:59 -0800 (PST) Message-ID: <1996012637.1232526779651.JavaMail.jira@brutus> Date: Wed, 21 Jan 2009 00:32:59 -0800 (PST) From: =?utf-8?Q?Alexander_Kj=C3=A4ll_=28JIRA=29?= To: issues@commons.apache.org Subject: [jira] Updated: (LANG-480) StringEscapeUtils.escapeHtml incorrectly converts unicode characters above U+00FFFF into 2 characters In-Reply-To: <2053374472.1232473020229.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/LANG-480?page=3Dcom.atlassian.= jira.plugin.system.issuetabpanels:all-tabpanel ] Alexander Kj=C3=A4ll updated LANG-480: --------------------------------- Attachment: lang-480.patch Here is a fix for the problem i think > StringEscapeUtils.escapeHtml incorrectly converts unicode characters abov= e U+00FFFF into 2 characters > -------------------------------------------------------------------------= ---------------------------- > > Key: LANG-480 > URL: https://issues.apache.org/jira/browse/LANG-480 > Project: Commons Lang > Issue Type: Bug > Affects Versions: 2.4 > Environment: doesn't matter > Reporter: Alexander Kj=C3=A4ll > Priority: Minor > Attachments: lang-480.patch > > Original Estimate: 4h > Remaining Estimate: 4h > > Characters that are represented as a 2 characters internaly by java are i= ncorrectly converted by the function. The following test displays the probl= em quite nicely: > import org.apache.commons.lang.*; > public class J2 { > public static void main(String[] args) throws Exception { > // this is the utf8 representation of the character: > // COUNTING ROD UNIT DIGIT THREE > // in unicode > // codepoint: U+1D362 > byte[] data =3D new byte[] { (byte)0xF0, (byte)0x9D, (byte)0x8D, = (byte)0xA2 }; > //output is: �� > // should be: 𝍢 > System.out.println("'" + StringEscapeUtils.escapeHtml(new String(= data, "UTF8")) + "'"); > } > } > Should be very quick to fix, feel free to drop me an email if you want a = patch. --=20 This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.