A
Aaron Anodide
Hello,
My question first: What is the correct way to deal with % signs in the
POST data?
Here's my situation - I have a cgi script recieving POST data:
PASS=hello%C2%A3
The %C2%A3 was generated by pressing ALT+156 (british pound sign).
Legacy code I'm using calls CGI::unescape to process the %'s, so in
this case it effectively calls (i don't know why is uses eval):
eval '$password = CGI::unescape($in[$i]);';
However, when this returs, length($password) = 7.
If I set a local variable to the same string:
$password1 = "hello£"; (this time using alt-156 directly in my
editor)
Then length($password1) = 6.
Then I call an external validation program, a C++ program compiled in
UNICODE:
system( "validate", $password );
It fails, because C2 and A3 appear as unique characters in argv[1].
BUT, if I call:
system( "validate", $password1 );
Then the program works.
Thanks in advance for anyone who takes the time to think about this
for me.
Aaron Anodide
My question first: What is the correct way to deal with % signs in the
POST data?
Here's my situation - I have a cgi script recieving POST data:
PASS=hello%C2%A3
The %C2%A3 was generated by pressing ALT+156 (british pound sign).
Legacy code I'm using calls CGI::unescape to process the %'s, so in
this case it effectively calls (i don't know why is uses eval):
eval '$password = CGI::unescape($in[$i]);';
However, when this returs, length($password) = 7.
If I set a local variable to the same string:
$password1 = "hello£"; (this time using alt-156 directly in my
editor)
Then length($password1) = 6.
Then I call an external validation program, a C++ program compiled in
UNICODE:
system( "validate", $password );
It fails, because C2 and A3 appear as unique characters in argv[1].
BUT, if I call:
system( "validate", $password1 );
Then the program works.
Thanks in advance for anyone who takes the time to think about this
for me.
Aaron Anodide