in reply to Escaping double quotes in complete document

Hello MeinName,

I am not familiar with the problem that you are having but I searched online and I found this module HTML::Entities give it a try.

Example from documentation:

use HTML::Entities; $a = "Våre norske tegn bør &#230res"; decode_entities($a); encode_entities($a, "\200-\377");

Hope this helps, BR.

Seeking for Perl wisdom...on the process of learning...not there...yet!

Replies are listed 'Best First'.
Re^2: Escaping double quotes in complete document
by MeinName (Novice) on Jun 26, 2017 at 13:28 UTC

    Hi thanos,

    thank you for your reply. Unfortunately it is not exactly what I was looking for. As I wrote, I came across HTML::Entities myself, but there's just too many scripts with waaay too many variables and arrays and whatnot to go along and decode/encode every single one by hand.

    I am looking for a method to tell Perl "Go ahead and just encode everything you get so that HTML entities are correctly loaded." Kind of like

    use open qw(:std :utf8);

    is doing for UTF-8 encoding.

    Best regards

    MeinName

      Hello again MeinName,

      Apologies I did not notice that.

      The only alternative way that I found is to force your whole script to use UTF-8 by default. For example:

      $ PERL_UNICODE=S perl script.pl

      You can read further on perlrun/Command Switches.

      Give it a try.

      Hope this helps.

      Seeking for Perl wisdom...on the process of learning...not there...yet!

        Hi thanos,

        I tried

        #!/usr/bin/perl -wCSD

        to run my scripts, but unfortunately that only solves the UTF-8 character problems and not my problem with the HTML entities.

        Thank you for your help, though :)