如何在 Pod 和 perldoc 中使用 Unicode 字符? [英] How do I use Unicode characters in Pod and perldoc?
本文介绍了如何在 Pod 和 perldoc 中使用 Unicode 字符?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我需要在我的 perl 文档中使用 utf-8 字符.如果我使用:
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
一切都很好.
我使用 Ubuntu/Debian.
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
是否有关于在 Pod 中使用特殊字符的 HowTo?
Is there a HowTo about using special characters in Pod?
这是一个使用德语变音符号Just a Test: äöüßÄÖ"的小例子:
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)
推荐答案
使用 =encoding utf-8
作为文件中的第一个 POD 指令,并使用相当新的 perldoc代码>(例如来自 5.10-maint).那么它应该可以工作了.
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.
这篇关于如何在 Pod 和 perldoc 中使用 Unicode 字符?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文