Does JavaScript have a chr function?
will producemy $string = ... from db ...; my $jscode = $string; $jscode =~ s/(\W)/ '" + chr(' . ord($1) . ') + "' /ge; $jscode =~ s/ \+ ""//g; $jscode = qq{"$jscode"};
for"line1" + chr(13) + "line2" + chr(13)
"line1\nline2\n"
In reply to Re: OT: Perl and Javascript - escaping newlines
by ikegami
in thread OT: Perl and Javascript - escaping newlines
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |