http://www.perlmonks.org?node_id=1199810


in reply to Re: Encoding Decoding on multiple formats RFC
in thread Encoding Decoding on multiple formats RFC

Hello AppleFritter,

Thank you for time and effort reading and replying to my request for comments. Hmmmm Unicode::Peek not a bad idea, it is exactly as you describe. The module meant to take a quick peek on the encoding. Well since I am also converting into hex why not Unicode::HexPeek?

Regarding the code tags, as fellow Monk hippo said I am using the <pre></pre> tags to encode the UTF-8 data.

Again thanks for the interesting ideas, I appreciate it. BR / Thanos

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

Replies are listed 'Best First'.
Re^3: Encoding Decoding on multiple formats RFC
by kcott (Archbishop) on Sep 21, 2017 at 09:28 UTC

    G'day Thanos,

    "... using the <pre></pre> tags to encode the UTF-8 data."

    That's quite correct to do that!

    You also need to replace special characters with entities:

    ForReplaceWith
    HTML&&amp;
    <&lt;
    >&gt;
    PerlMonks[&#91;
    ]&#93;

    [The "HTML" ones are generic (i.e. not just for this site); The "PerlMonks" ones are specific to this site to prevent automatic link generation.]

    These appear under the textarea when you're composing your message:

    "You may need to use entities for some characters, as follows. ..."

    Unfortunately, that list is no longer there when previewing, nor when editing after node creation.

    — Ken

      Hello kcott

      Thanks for the tip, it worked perfectly.

      Best Regards, Thanos

      Seeking for Perl wisdom...on the process of learning...not there...yet!
Re^3: Encoding Decoding on multiple formats RFC
by AppleFritter (Vicar) on Sep 21, 2017 at 09:52 UTC

    Well since I am also converting into hex why not Unicode::HexPeek?

    That also works. Personally I'd not get too specific however; perhaps you'll find yourself wanting to expand the module beyond hexadecimal "peeking" further down the road. Best not to paint oneself into a corner too early!

      Hello AppleFritter,

      You are absolutely right. Why to produce a dead lock to your self when you are just creating the module. Unicode::Peek it is. :D

      Thanks again for the time and effort.

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