[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: Forms, CGI ans special charaters

Subject: Re: Forms, CGI ans special charaters
From: Dave Jones <David.T.Jones@xxxxxxx>
Date: Wed, 29 Jul 1998 15:21:39 +0100
html special charaters
All,

I have managed to fix my problem with the special characters.
Conversion to ASCII can be accomplished by including the following.

# Convert plus's to spaces
  $parseString =~ s/\+/ /g;

# Convert %xx URLencoded to equiv ASCII characters
  $parseString =~ s/%(..)/chr(hex($1))/ge;  

Browsers don't display "<" chars as it could represent a tag in 
html. To get round the problem, you need to do the following
conversion for the 'main' special characters in HTML.

# Convert < > & " to 'html' special characters.
  $parseString =~ s/&/\&amp;/g;
  $parseString =~ s/</\&lt;/g;
  $parseString =~ s/>/\&gt;/g;
  $parseString =~ s/"/\&quot;/g;

&lt;    < (less than sign) 
&gt;    > (greater than sign) 
&amp;   & (The ampersand sign itself) 
&quot;  " (double quote) 

FYI more info on special characters can be had here
http://www.sandia.gov/sci_compute/symbols.html

Cheers,
Dave.

At 12:13 PM 7/29/98 +0100, Dave Jones wrote:
>WEB Masters,
>
>Has anybody tried passing an xml/sgml code through a form, I've got 
>a perl xml parser which awaits the input from a web form. However 
>when the form data arrives, it is URL encoded. There are perl programs 
>which convert this back to ascii, however some of the xml characters
>namely "<" seem to corrupt the conversion, and when displaying back to
>the web page I end up with text which is only showing the non encoded
>characters.
>
>Cheers
>Dave.
>
>


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.