Return-Path: Delivered-To: apmail-commons-user-archive@www.apache.org Received: (qmail 48521 invoked from network); 3 Sep 2008 14:56:51 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 3 Sep 2008 14:56:51 -0000 Received: (qmail 24011 invoked by uid 500); 3 Sep 2008 14:56:44 -0000 Delivered-To: apmail-commons-user-archive@commons.apache.org Received: (qmail 23945 invoked by uid 500); 3 Sep 2008 14:56:44 -0000 Mailing-List: contact user-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Commons Users List" Delivered-To: mailing list user@commons.apache.org Received: (qmail 23930 invoked by uid 99); 3 Sep 2008 14:56:44 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 03 Sep 2008 07:56:44 -0700 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of niall.pemberton@gmail.com designates 64.233.184.239 as permitted sender) Received: from [64.233.184.239] (HELO wr-out-0506.google.com) (64.233.184.239) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 03 Sep 2008 14:55:47 +0000 Received: by wr-out-0506.google.com with SMTP id 50so2479371wri.2 for ; Wed, 03 Sep 2008 07:56:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:references; bh=xJZR2bCjOpEjjx7swJOJxTY/LUhTLbg5ZdrJ0Lha4f4=; b=KPDrAcXR2lL1CyT+lvK9pQr3saibryN+qTgtzENLqH5MeOWhHMe9V6RLTBqSWxX6NV p82dh1CwbqrhBoNWZBHMYccvoY9WaDHNxlC2qnfz8ZZKbR3xCDUFGgqML20F5dTR30bn j2EVvlX2vb1fP7JNah1h0j4Rs0lwqh4e+XhNo= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:in-reply-to:mime-version :content-type:content-transfer-encoding:content-disposition :references; b=PiLBNWurWhVpEg288Lg3gH3k5nbV16upBQS0UmzdunWh64wJrWqjbld+WScKeASRQ2 bBLlut/TA33ryLx4lQD+D8Jj22jdJUgWxkt1TdrVvxwmgILyL6rNCE5M1Xig6Wip8u8J CNOIAO4veshqRDcbAn7MTdtFB4LYcmBfksGmU= Received: by 10.90.104.20 with SMTP id b20mr11469860agc.63.1220453760939; Wed, 03 Sep 2008 07:56:00 -0700 (PDT) Received: by 10.90.118.7 with HTTP; Wed, 3 Sep 2008 07:56:00 -0700 (PDT) Message-ID: <55afdc850809030756ke86e93dtdf0d9a37fc259ca4@mail.gmail.com> Date: Wed, 3 Sep 2008 15:56:00 +0100 From: "Niall Pemberton" To: "Commons Users List" Subject: Re: isEscaped In-Reply-To: <1195336e0809021128s6500f488q5c8b763f8fdc33c5@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <1195336e0809021128s6500f488q5c8b763f8fdc33c5@mail.gmail.com> X-Virus-Checked: Checked by ClamAV on apache.org On Tue, Sep 2, 2008 at 7:28 PM, Gabriel Reis wrote: > Hi, > > Is there any tool to verify if a String is escaped? Something like this: > > assertFalse( StringEscapeUtils.isHtmlEscaped("text") ); > > assertTrue( StringEscapeUtils.isHtmlEscaped("<b>text</b>") ); Perhaps one way to do this is to use the StringEscapeUtils's unescapeHtml() method and compare if the result equals the original. something like... if (value.equals(StringEscapeUtils.unescapeHtml(value))) { ... } http://commons.apache.org/lang/api-release/org/apache/commons/lang/StringEscapeUtils.html#unescapeHtml(java.lang.String) Niall > []s > Gabriel > --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscribe@commons.apache.org For additional commands, e-mail: user-help@commons.apache.org