Hi, As I say I try to decode the CGI params:
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);
The only thing that changes is this:
---------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
If I change the encoding in 'decode' from 'CP1251' to 'UTF-8' nothing really happens.
Best regards,
Kaloyan Iliev

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

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.