problems with escape/unescape 
Author Message
 problems with escape/unescape

I'm having a problem with CGI::escape and CGI::unescape. For example
when I decode %A8 I get the registered trademark symbol, circle-R, like
I'm supposed to. However, if I encode circle-R, I get %AE. Decoding %A1
yields the degree symbol; encoding the degree symbol yields %B0. I've
checked the FAQs, the PODs and the URI::Escape.pm, and I can't find a
reason anywhere for this behavior. I even examined the %escapes from
Escape.pm and it contains the correct translations.
http://www.*-*-*.com/
this problem. It contains a link to the source .pl.

TIA
Kelly Wm. Hoskins
--
Architectonic SynthesisPraxis
http://www.*-*-*.com/
http://www.*-*-*.com/
vox  972.503.8877
fax  972.503.8878
-----
jnana through karamayoga
antimemisis by telesis
-----
PGP info upon request.



Sat, 02 Nov 2002 03:00:00 GMT  
 problems with escape/unescape

"Kelly Wm. Hoskins" a crit :

Quote:

> I'm having a problem with CGI::escape and CGI::unescape. For example
> when I decode %A8 I get the registered trademark symbol, circle-R, like
> I'm supposed to. However, if I encode circle-R, I get %AE. Decoding %A1
> yields the degree symbol; encoding the degree symbol yields %B0. I've
> checked the FAQs, the PODs and the URI::Escape.pm, and I can't find a
> reason anywhere for this behavior. I even examined the %escapes from
> Escape.pm and it contains the correct translations.
> http://207.55.217.13/cgi-bin/umph.acgi is a simple script displaying
> this problem. It contains a link to the source .pl.

> TIA
> Kelly Wm. Hoskins

I looked a little at the problem and, for fun, I tried this:

for (0..255) { $escapes{chr($_)} = sprintf("%%%02X", $_); }
$c = "?";
$c=~s/([\0-\255])/$escapes{$1}/g;

And this gives %A8

However,

print chr(168); # A8 hex = 168

don't even give me the same character than uri_unescape("%A8") will
return.

If someones know the reason why it behaves like that. I'm interested in
knowing it too.

Sebastien Nadeau



Tue, 05 Nov 2002 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Delphi Training

2. Help - Stuck With 20 Records Per SQL Fetch ?????

3. WTB Delphi 1.0

4. URI::Escape, modifying %escapes

5. de-escaping data escaped bij javascript

6. URI::Escape, modifying %escapes

7. How to unescape special escapes \\, \n, \t etc. in a string in one go?

8. problem with C routines...

9. Q: Referential integrity on Paradox database prevents delete

10. Power Problem!

11. Reading Text into Arrays

12. problems with the \n escape character

 

 
Powered by phpBB® Forum Software