Namaste, dear Perl Monks and Nuns!
I have a little site to administrate that depends on Perl scripts printing HTML and JavaScript. The site stores data in and loads data from a database using SOAP::Lite and up until last week everything ran very smoothly. Unfortunately our servers got an update that raised Perl from version 5.10.1 to 5.16.3 and there the problems started. Firstly all special characters, like ä, ö, ü, ß and € got mangled by the encoding. This error was resolved by using
use open qw(:std :utf8); use Encode; use utf8;
to load the data, by writing
print header(-type=>'text/html',-charset=>'utf-8'); print start_html(-title => "FooBar");
to start the web page and by using
my $text=decode("utf8", $query->param("textbox"));
to get the data back from the page and store it in the DB.
Today I had to realize that it's also no longer possible to load strings from the database that contain double quotes, because the HTML textboxes see the double quote as an end marker for the textbox value. (EDIT: Saving content with double quotes is possible. I verified this directly on database level.)
There are probably even a few more characters that cause issues that I haven't stumbled upon yet.
I found that I can resolve the issue by using HTML::Entities and calling encode_entities() on the variable I want to see in my textbox, but I am loading hundreds of variables and several arrays of strings in one page visit and there is no way I can revisit every single script in my application to see which variables I maybe need to encode.
Is there any way I can encode the whole HTML part of my script or a way to circumvent this mess?
Thanks alot in advance
In reply to Escaping double quotes in complete document by MeinName
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |