Do a search for HTML Entities with regards to Java. PHP has htmlentities() and htmlspecialchars() function that does something similar to what you're asking for. I'm sure there would be some kind of equivalent in Java.
Shawn On Thursday 29 September 2005 15:37, Cirez Communications, inc. wrote: > Quick q: > > In trying to sanitaze user input (I know, I know, there is no easy way > to do this), is there is rather fast/uncomplicated way to accomplish > this? > > A quick and dirty way to do this in perl is to create a hash with the > ilegal characters and its replacements (key/value), then create a sub > that takes a dirty string as argument, look it up and return the > sanitized version. This is all well and good; but trying to do the > same in Java it's rather resource intensive. > > Is there a simple way to accomplish this, given a list of 25 or so > character to scrubb? I don't want to delete the characters just return > the ASCII code in HTML compatible format i.e ASCII (67) as C > Using java's: (Object).replace(dirty_string, sanitized_string); for > every possible character takes way to much time and resources... > -- > =*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*= > -------------------Cirez Communications, inc.---------------- > ----------------------Juan Alberto Cirez--------------------- > -----------------------Senior Consultant--------------------- > [EMAIL PROTECTED] > =*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*= > Sunny and Beautiful Vancouver, Canada. > =*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*= > > _______________________________________________ > clug-talk mailing list > [email protected] > http://clug.ca/mailman/listinfo/clug-talk_clug.ca > Mailing List Guidelines (http://clug.ca/ml_guidelines.php) > **Please remove these lines when replying
pgptt8k6HzPs6.pgp
Description: PGP signature
_______________________________________________ clug-talk mailing list [email protected] http://clug.ca/mailman/listinfo/clug-talk_clug.ca Mailing List Guidelines (http://clug.ca/ml_guidelines.php) **Please remove these lines when replying

