Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I use Unicode characters in Pod and perldoc?

Tags:

I need to use utf-8 characters in my perl-documentation. If I use:

perldoc MyMod.pm 

I see strange characters. If I use:

pod2text MyMod.pm 

everything is fine.

I use Ubuntu/Debian.

$ locale LANG=de_DE.UTF-8 LC_CTYPE="de_DE.UTF-8" LC_NUMERIC="de_DE.UTF-8" LC_TIME="de_DE.UTF-8" LC_COLLATE="de_DE.UTF-8" LC_MONETARY="de_DE.UTF-8" LC_MESSAGES="de_DE.UTF-8" LC_PAPER="de_DE.UTF-8" LC_NAME="de_DE.UTF-8" LC_ADDRESS="de_DE.UTF-8" LC_TELEPHONE="de_DE.UTF-8" LC_MEASUREMENT="de_DE.UTF-8" LC_IDENTIFICATION="de_DE.UTF-8" LC_ALL=de_DE.UTF-8 

Is there a HowTo about using special characters in Pod?

Here is a small example using german umlauts "Just a Test: äöüßÄÖ":

$ perldoc perl/MyMod.pm <standard input>:72: warning: can't find character with input code 159 <standard input>:72: warning: can't find character with input code 150 MyMod(3)              User Contributed Perl Documentation             MyMod(3)  NAME         MyMod.pm - Just a Test: äöüÃÃà  perl v5.10.0                      2008-10-16                          MyMod(3) 
like image 318
maletin Avatar asked Oct 16 '08 09:10

maletin


People also ask

How do you represent in Unicode?

Unicode uses two encoding forms: 8-bit and 16-bit, based on the data type of the data that is being that is being encoded. The default encoding form is 16-bit, where each character is 16 bits (2 bytes) wide. Sixteen-bit encoding form is usually shown as U+hhhh, where hhhh is the hexadecimal code point of the character.

What characters does Unicode use?

Unicode covers all the characters for all the writing systems of the world, modern and ancient. It also includes technical symbols, punctuations, and many other characters used in writing text.

What is Unicode in Perl?

Description. This document gives a general idea of Unicode and how to use Unicode in Perl. Unicode. Unicode is a character set standard which plans to codify all of the writing systems of the world, plus many other symbols.

What is Unicode text example?

A code point takes the form of U+<hex-code> , ranging from U+0000 to U+10FFFF . An example code point looks like this: U+004F . Its meaning depends on the character encoding used. Unicode defines different characters encodings, the most used ones being UTF-8, UTF-16 and UTF-32.


2 Answers

Use =encoding utf-8 as the first POD directive in your file, and use a fairly recent perldoc (for example from 5.10-maint). Then it should work.

like image 194
moritz Avatar answered Dec 13 '22 03:12

moritz


Found this RT ticket.... http://rt.cpan.org/Public/Bug/Display.html?id=39000

This "bug" seems to be introduced with Perl 5.10 and perhaps this pod2man --utf8 needs to be used.

like image 44
draegtun Avatar answered Dec 13 '22 04:12

draegtun