Return-Path: Delivered-To: apmail-struts-dev-archive@www.apache.org Received: (qmail 74529 invoked from network); 24 Apr 2006 22:48:24 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 24 Apr 2006 22:48:24 -0000 Received: (qmail 89725 invoked by uid 500); 24 Apr 2006 22:48:20 -0000 Delivered-To: apmail-struts-dev-archive@struts.apache.org Received: (qmail 89681 invoked by uid 500); 24 Apr 2006 22:48:20 -0000 Mailing-List: contact dev-help@struts.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "Struts Developers List" Reply-To: "Struts Developers List" Delivered-To: mailing list dev@struts.apache.org Received: (qmail 89670 invoked by uid 99); 24 Apr 2006 22:48:20 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 24 Apr 2006 15:48:20 -0700 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received: from [209.237.227.198] (HELO brutus.apache.org) (209.237.227.198) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 24 Apr 2006 15:48:19 -0700 Received: from brutus (localhost.localdomain [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id BBA5C7142C4 for ; Mon, 24 Apr 2006 22:47:10 +0000 (GMT) Message-ID: <24129329.1145918830765.JavaMail.jira@brutus> Date: Mon, 24 Apr 2006 22:47:10 +0000 (GMT+00:00) From: "David Evans (JIRA)" To: dev@struts.apache.org Subject: [jira] Reopened: (STR-1850) ResponseFilter does not handle UTF-8 encoded characters with &# 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 X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N [ http://issues.apache.org/struts/browse/STR-1850?page=3Dall ] =20 David Evans reopened STR-1850: ------------------------------ Assign To: David Evans (was: Struts Developer Mailing List) > ResponseFilter does not handle UTF-8 encoded characters with &# > --------------------------------------------------------------- > > Key: STR-1850 > URL: http://issues.apache.org/struts/browse/STR-1850 > Project: Struts Action 1 > Type: Bug > Components: Action > Versions: 1.1 Final > Environment: Operating System: All > Platform: All > Reporter: Dave Hodson > Assignee: David Evans > > If I have a UTF-8 encoded character like "堂" (=C3=A5=C2=A0=C2=82, = a building in > Traditional Chinese) and use this value in an html tag (e.g. html:text), = the '&' > is encoded to "&", which produces output that looks like "&#22530= ;"=20 > The filter method should "look ahead" when it goes into the '&' case and = if the > following char is '#', it should not modify the '&' char.=20 > The filter method from ResponseUtils with a suggested change: > for (int i =3D 0; i < content.length; i++) { > switch (content[i]) { > case '<': > result.append("<"); > break; > case '>': > result.append(">"); > break; > case '&': > --->=09 if (content[i + 1] !=3D '#') > --->=09=09 result.append("&"); > --->=09=09else > result.append("&"); > break; > case '"': > result.append("""); > break; > case '\'': > result.append("'"); > break; > default: > result.append(content[i]); > } > } > This probably needs a minor adjustment, as this doesn't handle the case w= here > the '&' char is the last character in the String (bounds check) --=20 This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/struts/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org For additional commands, e-mail: dev-help@struts.apache.org