You say "to create a new utf8 string by decoding the value returned by "param('select')" but instead of using decode() you used encode().

You are right -- I was clearly wrong there, I should have known better and should have been more careful. I apologize.

DID YOU EVEN READ IT? AND IF YOU DID HOW YOU EXPLAIN IT?

I tried to read it, but so much of it made so little sense and was frankly erroneous. The only explanation I can imagine is that the code actually working on your website now is not the same as the code you posted. For example, when you get to this line:

unless ( grep /^\Q$_\E$/, @menu_files )
$_ has not actually been set to anything in particular. I guess you just left out the part where you assign something to $_. And then this other thing was probably just a typo when you posted (can you spot the mistake?) -- or else it has no effect at all on the ultimate result:
for ($data) { #Replace special chars like single & double quotes to i +ts literally values s/\n/\\n/g; s/'/\\'/g; s/"/\"/g; tr/\cM//d; }
When you can figure out how to post your code correctly, without silly mistakes like this, you'll get a better quality of response (and other monks will be less critical of your posts).

No matter. I'm happy for you that you have something working -- really. (But personally, I would get rid of the "char-by-char.js" display approach; it's way too slow for the amount of text in each file.)


In reply to Re^7: somethign wrong with the sumbit by graff
in thread somethign wrong with the sumbit by Nik

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.