Re: Problems with Apache::compat and german special chars

2002-12-15 Thread Stas Bekman
[perl.apache.org keeps on timing out once in a while :( reposting]

Tom Schindl wrote:
 Problems with Apache::compat

 CGI-PARAM-STRING: header=%DC%DC%DC%DCbody=%D6%D6%D6%D6type=save_thread

 cut--
 [Sun Dec 08 21:39:09 2002] [error] [client 127.0.0.1] Character in c
 format wrapped at
 
/usr/bestsolution/lib/perl5/site_perl/5.8.0/i386-linux-thread-multi/Apache2/Apache/compat.pm 
line 217.
 , referer: http://localhost/discussion-board
 cut--

 When I copy the lines of interest into a small perl program and execute
 it, everything works perfectly. What's going wrong there?

 cut--
 map { s/%([0-9a-fA-F]{2})/pack(c,hex($1))/ge; $_; } split /[=;]/,
 $string, -1
 cut--

Doug has fixed this already in the cvs version of mod_perl. Ditto for the
s/+/ / transform:

revision 1.71
date: 2002/11/23 22:35:06;  author: dougm;  state: Exp;  lines: +2 -0
PR:
Obtained from:
Submitted by: Walery Studennikov [EMAIL PROTECTED]
Reviewed by:  dougm
tr/+/ /; in parse_args compat method

revision 1.70
date: 2002/10/21 20:21:34;  author: dougm;  state: Exp;  lines: +1 -1
PR:
Obtained from:
Submitted by:   Walery Studennikov [EMAIL PROTECTED]
Reviewed by:dougm
fix parse_args compat method to support non-ascii characters

The problem was that the buggy code was doing pack(c, $num) which 
expects a
number in range -128..127, whereas a fixed version does pack(C, $num), 
which works with 0..255.




_
Stas Bekman JAm_pH  --   Just Another mod_perl Hacker
http://stason.org/  mod_perl Guide   http://perl.apache.org/guide
mailto:[EMAIL PROTECTED]  http://ticketmaster.com http://apacheweek.com
http://singlesheaven.com http://perl.apache.org http://perlmonth.com/




Re: Problems with Apache::compat and german special chars

2002-12-10 Thread Tom Schindl
one more patch on Apache::compat. When SUBMITING-Forms a whitespace(\s+)
is replaced by +. We have to retransform this.



Am Son, 2002-12-08 um 21.46 schrieb Tom Schindl:
 Problems with Apache::compat
 
 CGI-PARAM-STRING: header=%DC%DC%DC%DCbody=%D6%D6%D6%D6type=save_thread
 
 cut--
 [Sun Dec 08 21:39:09 2002] [error] [client 127.0.0.1] Character in c
 format wrapped at
 
/usr/bestsolution/lib/perl5/site_perl/5.8.0/i386-linux-thread-multi/Apache2/Apache/compat.pm
 line 217.
 , referer: http://localhost/discussion-board
 cut--
 
 When I copy the lines of interest into a small perl program and execute
 it, everything works perfectly. What's going wrong there?
 
 cut--
 map { s/%([0-9a-fA-F]{2})/pack(c,hex($1))/ge; $_; } split /[=;]/,
 $string, -1
 cut--
 
 thx
 
 tom
-- 
Tom Schindl [EMAIL PROTECTED]
bestsolution.at

215,216c215,218
 $string =~ s/\+/ /g;
 return map { s/%([0-9a-fA-F]{2})/chr(hex($1))/ge; $_; } split /[=;]/, $string, -1;
---
 return map {
 s/%([0-9a-fA-F]{2})/pack(c,hex($1))/ge;
 $_;
 } split /[=;]/, $string, -1;



Problems with Apache::compat and german special chars

2002-12-08 Thread Tom Schindl
Problems with Apache::compat

CGI-PARAM-STRING: header=%DC%DC%DC%DCbody=%D6%D6%D6%D6type=save_thread

cut--
[Sun Dec 08 21:39:09 2002] [error] [client 127.0.0.1] Character in c
format wrapped at
/usr/bestsolution/lib/perl5/site_perl/5.8.0/i386-linux-thread-multi/Apache2/Apache/compat.pm
 line 217.
, referer: http://localhost/discussion-board
cut--

When I copy the lines of interest into a small perl program and execute
it, everything works perfectly. What's going wrong there?

cut--
map { s/%([0-9a-fA-F]{2})/pack(c,hex($1))/ge; $_; } split /[=;]/,
$string, -1
cut--

thx

tom
-- 
b e s t s o l u t i o n . a tEDV Systemhaus GmbH

Thomas SchindlProject Management   mobile ++43/664/314 59 58

Anton-Rauch-Str.6aA-6020 Innsbruck fax   ++43/512/935834
http://www.bestsolution.at phone ++43/512/935834



signature.asc
Description: Dies ist ein digital signierter Nachrichtenteil


Re: Problems with Apache::compat and german special chars

2002-12-08 Thread Tom Schindl
I've found a work around for the problem, i would call it a patch
because i don't know yet which side affects this replacement has. 

I have replaced
cut---
return map { s/%([0-9a-fA-F]{2})/pack(c,hex($1))/ge; $_; } split
/[=;]/, $string, -1;
cut---
by
cut---
return map { s/%([0-9a-fA-F]{2})/chr(hex($1))/ge; $_; } split /[=;]/,
$string, -1;
cut---

I don't know if pack has any advantages still I know that HTML::Entities
converts characters this way, so it should work in most situations.
Still does anybody know what's wrong with pack into mod_perl although it
works in perl itself without any problems.

I've also added a diff.

thx

tom

Am Son, 2002-12-08 um 21.46 schrieb Tom Schindl:
 Problems with Apache::compat
 
 CGI-PARAM-STRING: header=%DC%DC%DC%DCbody=%D6%D6%D6%D6type=save_thread
 
 cut--
 [Sun Dec 08 21:39:09 2002] [error] [client 127.0.0.1] Character in c
 format wrapped at
 
/usr/bestsolution/lib/perl5/site_perl/5.8.0/i386-linux-thread-multi/Apache2/Apache/compat.pm
 line 217.
 , referer: http://localhost/discussion-board
 cut--
 
 When I copy the lines of interest into a small perl program and execute
 it, everything works perfectly. What's going wrong there?
 
 cut--
 map { s/%([0-9a-fA-F]{2})/pack(c,hex($1))/ge; $_; } split /[=;]/,
 $string, -1
 cut--
 
 thx
 
 tom
-- 
Tom Schindl [EMAIL PROTECTED]



signature.asc
Description: Dies ist ein digital signierter Nachrichtenteil


Re: Problems with Apache::compat and german special chars

2002-12-08 Thread Tom Schindl
Sorry here's the diff which includes one more thing:

When SUBMITING-Forms a whitespace(\s+) is replaced by +. We have to
retransform this.

tom

Am Son, 2002-12-08 um 22.39 schrieb Tom Schindl:
 I've found a work around for the problem, i would call it a patch
 because i don't know yet which side affects this replacement has. 
 
 I have replaced
 cut---
 return map { s/%([0-9a-fA-F]{2})/pack(c,hex($1))/ge; $_; } split
 /[=;]/, $string, -1;
 cut---
 by
 cut---
 return map { s/%([0-9a-fA-F]{2})/chr(hex($1))/ge; $_; } split /[=;]/,
 $string, -1;
 cut---
 
 I don't know if pack has any advantages still I know that HTML::Entities
 converts characters this way, so it should work in most situations.
 Still does anybody know what's wrong with pack into mod_perl although it
 works in perl itself without any problems.
 
 I've also added a diff.
 
 thx
 
 tom
 
 Am Son, 2002-12-08 um 21.46 schrieb Tom Schindl:
  Problems with Apache::compat
  
  CGI-PARAM-STRING: header=%DC%DC%DC%DCbody=%D6%D6%D6%D6type=save_thread
  
  cut--
  [Sun Dec 08 21:39:09 2002] [error] [client 127.0.0.1] Character in c
  format wrapped at
  
/usr/bestsolution/lib/perl5/site_perl/5.8.0/i386-linux-thread-multi/Apache2/Apache/compat.pm
 line 217.
  , referer: http://localhost/discussion-board
  cut--
  
  When I copy the lines of interest into a small perl program and execute
  it, everything works perfectly. What's going wrong there?
  
  cut--
  map { s/%([0-9a-fA-F]{2})/pack(c,hex($1))/ge; $_; } split /[=;]/,
  $string, -1
  cut--
  
  thx
  
  tom
-- 
Tom Schindl [EMAIL PROTECTED]

215,216c215,218
 $string =~ s/\+/ /g;
 return map { s/%([0-9a-fA-F]{2})/chr(hex($1))/ge; $_; } split /[=;]/, $string, -1;
---
 return map {
 s/%([0-9a-fA-F]{2})/pack(c,hex($1))/ge;
 $_;
 } split /[=;]/, $string, -1;



signature.asc
Description: Dies ist ein digital signierter Nachrichtenteil