The only thing that changes is this:use Encode; my $chapid = CGI::param('chap-id'); my $chapchalange = CGI::param('chap-challenge'); $chapid = Encode::decode('CP1251', $chapid, Encode::FB_CROAK); $chapchalange = Encode::decode('CP1251', $chapchalange, Encode::FB_CRO +AK);
If I change the encoding in 'decode' from 'CP1251' to 'UTF-8' nothing really happens.---------print chapid to STDERR----------------- \027 ---------Dump chapid before decode---------- SV = PVMG(0x80d0988e8) at 0x80d3234e0 REFCNT = 1 FLAGS = (PADMY,POK,pPOK) IV = 0 NV = 0 PV = 0x80d35f118 "\\027"\0 CUR = 4 LEN = 8 ---------Dump chapid after decode---------- SV = PVMG(0x80d0988e8) at 0x80d3234e0 REFCNT = 1 FLAGS = (PADMY,POK,pPOK,UTF8) IV = 0 NV = 0 PV = 0x80d35f5d8 "\\027"\0 [UTF8 "\\027"] CUR = 4 LEN = 8
In reply to Re^2: Perl CGI UTF8 AND CHAP PASSWORD VERIFICATION
by kaloyan_iliev
in thread Perl CGI UTF8 AND CHAP PASSWORD VERIFICATION
by kaloyan_iliev
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |