PerlBroker has asked for the wisdom of the Perl Monks concerning the following question:
My input is UTF-8 from the HTML form, and the script is roughly this one:Cannot decode string with wide characters at /usr/lib/perl/5.10/Encode +.pm line 174.
In general, if a value from the HTML textform contains one UTF-8 character, I get that error. Any help is appreciated.#!/usr/bin/perl use strict; use warnings; use utf8; use CGI qw(-utf8); use Encode; use encoding 'utf8'; use CGI::Carp qw(croak fatalsToBrowser); # etc... $| = 1; binmode(STDOUT, ":utf8"); binmode(STDIN, ":utf8"); my $q = new CGI; croak("It works yet..."); my $referer_url = "@{[ $q->url ]}"; croak("Cannot decode string... error before this line.");
|
|---|