Hello, Ranjan,

0, Really another much more neat solution, isn't it?

1, However, don't you think it a little less understandable,
 and performance might also be a little worse affected
 due to the "replace" of strings ? ^_^ (Just kidding)

2, Moreover, the function "escape" seems incompatible
 with different browsers.

3, How will it behave if "%" is included in the input string?

4, In a word, your posted problem is not so simple
 as is originally imagined, isn't it?

 Best regards!

----------------------------------------
Romantic Emotionalists Must Endure Ordeals.
Email1(200103): [EMAIL PROTECTED]
Email2(200011): [EMAIL PROTECTED]
Email3(199908): [EMAIL PROTECTED]
Email4(199906): [EMAIL PROTECTED]
Office: Tokyo, Japan http://www.gecapital.com
Home: Dalian, Liaoning, China (Hometown: Hunan)
----------------------------------------

-----Original Message-----
From: Priya Ranjan Dash [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, March 21, 2001 6:09 PM
To: [EMAIL PROTECTED]
Subject: Re: character to byte

Hi Zeng,
Thanks for the help.
But i have done something like this:
function getByteLength (strCharString)
{
        theESCString=theESCString.escape(strCharString);
        theESCString=theESCString.replace(/%u\w{4}/g,"**");
        return theESCString.length;
}

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets

Reply via email to