perldoc/POD encoding question

Zbigniew Koziol softquake-Re5JQEeQqe8AvxtiuMwx3w at public.gmane.org
Tue May 20 19:46:26 UTC 2008


Hello Madi

Looks like Chineese? I am not sure but take care of the following:

1. use utf8;
2. Be sure that your terminal can display characters properly.
3. binmode STDIN,":utf8" -- to let perl "know" that perl may receive
utf8 data in STDIN
4. Similar way with STDOUT if needed.

In general utf8 is very tricky and I had a lot of fun when writing for
the first time scripts for utf8 in Russian.

Ah, and take care what your text editor does with encoded text. For me
just simple gedit worked well enough.

zb.


On Tue, May 20, 2008 at 3:30 PM, Madison Kelly <linux at alteeve.com> wrote:
> Hi all,
>
>  I originally tried to ask this on TPM, but it seems to have a problem, so
> I'll ask here, if that's okay. :)
>
>  I'm having trouble with UTF-8 characters in my module's POD. I've got
> the entry (truncated for brevity):
>
> =item new
>
> =encoding UTF-8
>
>  #-----
>  use TB::Get;
>
>  # Get a handle on the TB::HumanReadable methods.
>  my $hr=TB::Get->new;
>
>  # You can set (...) as a hash reference. Ie:
>  my $hr=TB::Get->new({
>        use_base_2      =>      0,
>        use_24h         =>      0,
>        say_am          =>      "午前",
>        say_pm          =>      "午後",
>        date_seperator  =>      "/",
>        time_seperator  =>      "."
>  });
>   #-----
>
> This is the constructor method used to access this module's methods.
>
> =cut
>
>  Now, when I try to read the POD using perldoc, I get:
>
> -=-=-=-=-=-
>       new
>          #-----
>          use TB::Get;
>
>          # Get a handle on the TB::HumanReadable methods.
>          my $hr=TB::Get->new;
>
>          # You can set (...) as a hash reference. Ie:
>          my $hr=TB::Get->new({
>                use_base_2      =>      0,
>                use_24h         =>      0,
>                say_am          =>      "åå",
>                say_pm          =>      "åå¾",
>                date_seperator  =>      "/",
>                time_seperator  =>      "."
>          });
> -=-=-=-=-=-
>
>  At the command line, I get:
>
> $ perldoc TB/Get
> ./TB/Get.pm:73: Unknown command paragraph "=encoding utf8"
> <standard input>:222: warning: can't find numbered character 141
> <standard input>:222: warning: can't find numbered character 141
> <standard input>:223: warning: can't find numbered character 141
> <standard input>:223: warning: can't find numbered character 140
>
>  Now, the '=encoding utf8' string is taken directly from the 'perldoc
> perlpod' documentation...
>
>  Any tips on what I am doing wrong?
>
> Thanks!
>
> Madi
>
> --
> The Toronto Linux Users Group.      Meetings: http://gtalug.org/
> TLUG requests: Linux topics, No HTML, wrap text below 80 columns
> How to UNSUBSCRIBE: http://gtalug.org/wiki/Mailing_lists
>


More information about the Legacy mailing list