如何在Pod和perldoc中使用Unicode字符? [英] How do I use Unicode characters in Pod and perldoc?

查看:154
本文介绍了如何在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

有没有一个HowTo关于在Pod中使用特殊字符?

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)


推荐答案

code> = 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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆