| 1 |
.\" -*- mode: troff; coding: utf-8 -*- |
| 2 |
.\" Automatically generated by Pod::Man 5.0102 (Pod::Simple 3.45) |
| 3 |
.\" |
| 4 |
.\" Standard preamble: |
| 5 |
.\" ======================================================================== |
| 6 |
.de Sp \" Vertical space (when we can't use .PP) |
| 7 |
.if t .sp .5v |
| 8 |
.if n .sp |
| 9 |
.. |
| 10 |
.de Vb \" Begin verbatim text |
| 11 |
.ft CW |
| 12 |
.nf |
| 13 |
.ne \\$1 |
| 14 |
.. |
| 15 |
.de Ve \" End verbatim text |
| 16 |
.ft R |
| 17 |
.fi |
| 18 |
.. |
| 19 |
.\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>. |
| 20 |
.ie n \{\ |
| 21 |
. ds C` "" |
| 22 |
. ds C' "" |
| 23 |
'br\} |
| 24 |
.el\{\ |
| 25 |
. ds C` |
| 26 |
. ds C' |
| 27 |
'br\} |
| 28 |
.\" |
| 29 |
.\" Escape single quotes in literal strings from groff's Unicode transform. |
| 30 |
.ie \n(.g .ds Aq \(aq |
| 31 |
.el .ds Aq ' |
| 32 |
.\" |
| 33 |
.\" If the F register is >0, we'll generate index entries on stderr for |
| 34 |
.\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index |
| 35 |
.\" entries marked with X<> in POD. Of course, you'll have to process the |
| 36 |
.\" output yourself in some meaningful fashion. |
| 37 |
.\" |
| 38 |
.\" Avoid warning from groff about undefined register 'F'. |
| 39 |
.de IX |
| 40 |
.. |
| 41 |
.nr rF 0 |
| 42 |
.if \n(.g .if rF .nr rF 1 |
| 43 |
.if (\n(rF:(\n(.g==0)) \{\ |
| 44 |
. if \nF \{\ |
| 45 |
. de IX |
| 46 |
. tm Index:\\$1\t\\n%\t"\\$2" |
| 47 |
.. |
| 48 |
. if !\nF==2 \{\ |
| 49 |
. nr % 0 |
| 50 |
. nr F 2 |
| 51 |
. \} |
| 52 |
. \} |
| 53 |
.\} |
| 54 |
.rr rF |
| 55 |
.\" ======================================================================== |
| 56 |
.\" |
| 57 |
.IX Title "Pod::Escapes 3perl" |
| 58 |
.TH Pod::Escapes 3perl 2025-11-16 "perl v5.40.1" "Perl Programmers Reference Guide" |
| 59 |
.\" For nroff, turn off justification. Always turn off hyphenation; it makes |
| 60 |
.\" way too many mistakes in technical documents. |
| 61 |
.if n .ad l |
| 62 |
.nh |
| 63 |
.SH NAME |
| 64 |
Pod::Escapes \- for resolving Pod E<...> sequences |
| 65 |
.SH SYNOPSIS |
| 66 |
.IX Header "SYNOPSIS" |
| 67 |
.Vb 7 |
| 68 |
\& use Pod::Escapes qw(e2char); |
| 69 |
\& ...la la la, parsing POD, la la la... |
| 70 |
\& $text = e2char($e_node\->label); |
| 71 |
\& unless(defined $text) { |
| 72 |
\& print "Unknown E sequence \e"", $e_node\->label, "\e"!"; |
| 73 |
\& } |
| 74 |
\& ...else print/interpolate $text... |
| 75 |
.Ve |
| 76 |
.SH DESCRIPTION |
| 77 |
.IX Header "DESCRIPTION" |
| 78 |
This module provides things that are useful in decoding |
| 79 |
Pod E<...> sequences. Presumably, it should be used |
| 80 |
only by Pod parsers and/or formatters. |
| 81 |
.PP |
| 82 |
By default, Pod::Escapes exports none of its symbols. But |
| 83 |
you can request any of them to be exported. |
| 84 |
Either request them individually, as with |
| 85 |
\&\f(CW\*(C`use Pod::Escapes qw(symbolname symbolname2...);\*(C'\fR, |
| 86 |
or you can do \f(CW\*(C`use Pod::Escapes qw(:ALL);\*(C'\fR to get all |
| 87 |
exportable symbols. |
| 88 |
.SH GOODIES |
| 89 |
.IX Header "GOODIES" |
| 90 |
.IP e2char($e_content) 4 |
| 91 |
.IX Item "e2char($e_content)" |
| 92 |
Given a name or number that could appear in a |
| 93 |
\&\f(CW\*(C`E<name_or_num>\*(C'\fR sequence, this returns the string that |
| 94 |
it stands for. For example, \f(CWe2char(\*(Aqsol\*(Aq)\fR, \f(CWe2char(\*(Aq47\*(Aq)\fR, |
| 95 |
\&\f(CWe2char(\*(Aq0x2F\*(Aq)\fR, and \f(CWe2char(\*(Aq057\*(Aq)\fR all return "/", |
| 96 |
because \f(CW\*(C`E<sol>\*(C'\fR, \f(CW\*(C`E<47>\*(C'\fR, \f(CW\*(C`E<0x2f>\*(C'\fR, |
| 97 |
and \f(CW\*(C`E<057>\*(C'\fR, all mean "/". If |
| 98 |
the name has no known value (as with a name of "qacute") or is |
| 99 |
syntactically invalid (as with a name of "1/4"), this returns undef. |
| 100 |
.IP e2charnum($e_content) 4 |
| 101 |
.IX Item "e2charnum($e_content)" |
| 102 |
Given a name or number that could appear in a |
| 103 |
\&\f(CW\*(C`E<name_or_num>\*(C'\fR sequence, this returns the number of |
| 104 |
the Unicode character that this stands for. For example, |
| 105 |
\&\f(CWe2char(\*(Aqsol\*(Aq)\fR, \f(CWe2char(\*(Aq47\*(Aq)\fR, |
| 106 |
\&\f(CWe2char(\*(Aq0x2F\*(Aq)\fR, and \f(CWe2char(\*(Aq057\*(Aq)\fR all return 47, |
| 107 |
because \f(CW\*(C`E<sol>\*(C'\fR, \f(CW\*(C`E<47>\*(C'\fR, \f(CW\*(C`E<0x2f>\*(C'\fR, |
| 108 |
and \f(CW\*(C`E<057>\*(C'\fR, all mean "/", whose Unicode number is 47. If |
| 109 |
the name has no known value (as with a name of "qacute") or is |
| 110 |
syntactically invalid (as with a name of "1/4"), this returns undef. |
| 111 |
.ie n .IP $Name2character{\fIname\fR} 4 |
| 112 |
.el .IP \f(CW$Name2character\fR{\fIname\fR} 4 |
| 113 |
.IX Item "$Name2character{name}" |
| 114 |
Maps from names (as in \f(CW\*(C`E<\fR\f(CIname\fR\f(CW>\*(C'\fR) like "eacute" or "sol" |
| 115 |
to the string that each stands for. Note that this does not |
| 116 |
include numerics (like "64" or "x981c"). Under old Perl versions |
| 117 |
(before 5.7) you get a "?" in place of characters whose Unicode |
| 118 |
value is over 255. |
| 119 |
.ie n .IP $Name2character_number{\fIname\fR} 4 |
| 120 |
.el .IP \f(CW$Name2character_number\fR{\fIname\fR} 4 |
| 121 |
.IX Item "$Name2character_number{name}" |
| 122 |
Maps from names (as in \f(CW\*(C`E<\fR\f(CIname\fR\f(CW>\*(C'\fR) like "eacute" or "sol" |
| 123 |
to the Unicode value that each stands for. For example, |
| 124 |
\&\f(CW$Name2character_number{\*(Aqeacute\*(Aq}\fR is 201, and |
| 125 |
\&\f(CW$Name2character_number{\*(Aqeacute\*(Aq}\fR is 8364. You get the correct |
| 126 |
Unicode value, regardless of the version of Perl you're using \-\- |
| 127 |
which differs from \f(CW%Name2character\fR's behavior under pre\-5.7 Perls. |
| 128 |
.Sp |
| 129 |
Note that this hash does not |
| 130 |
include numerics (like "64" or "x981c"). |
| 131 |
.ie n .IP $Latin1Code_to_fallback{\fIinteger\fR} 4 |
| 132 |
.el .IP \f(CW$Latin1Code_to_fallback\fR{\fIinteger\fR} 4 |
| 133 |
.IX Item "$Latin1Code_to_fallback{integer}" |
| 134 |
For numbers in the range 160 (0x00A0) to 255 (0x00FF), this maps |
| 135 |
from the character code for a Latin\-1 character (like 233 for |
| 136 |
lowercase e\-acute) to the US-ASCII character that best aproximates |
| 137 |
it (like "e"). You may find this useful if you are rendering |
| 138 |
POD in a format that you think deals well only with US-ASCII |
| 139 |
characters. |
| 140 |
.ie n .IP $Latin1Char_to_fallback{\fIcharacter\fR} 4 |
| 141 |
.el .IP \f(CW$Latin1Char_to_fallback\fR{\fIcharacter\fR} 4 |
| 142 |
.IX Item "$Latin1Char_to_fallback{character}" |
| 143 |
Just as above, but maps from characters (like "\exE9", |
| 144 |
lowercase e\-acute) to characters (like "e"). |
| 145 |
.ie n .IP $Code2USASCII{\fIinteger\fR} 4 |
| 146 |
.el .IP \f(CW$Code2USASCII\fR{\fIinteger\fR} 4 |
| 147 |
.IX Item "$Code2USASCII{integer}" |
| 148 |
This maps from US-ASCII codes (like 32) to the corresponding |
| 149 |
character (like space, for 32). Only characters 32 to 126 are |
| 150 |
defined. This is meant for use by \f(CWe2char($x)\fR when it senses |
| 151 |
that it's running on a non-ASCII platform (where chr(32) doesn't |
| 152 |
get you a space \-\- but \f(CW$Code2USASCII\fR{32} will). It's |
| 153 |
documented here just in case you might find it useful. |
| 154 |
.SH CAVEATS |
| 155 |
.IX Header "CAVEATS" |
| 156 |
On Perl versions before 5.7, Unicode characters with a value |
| 157 |
over 255 (like lambda or emdash) can't be conveyed. This |
| 158 |
module does work under such early Perl versions, but in the |
| 159 |
place of each such character, you get a "?". Latin\-1 |
| 160 |
characters (characters 160\-255) are unaffected. |
| 161 |
.PP |
| 162 |
Under EBCDIC platforms, \f(CWe2char($n)\fR may not always be the |
| 163 |
same as \f(CW\*(C`chr(e2charnum($n))\*(C'\fR, and ditto for |
| 164 |
\&\f(CW$Name2character{$name}\fR and |
| 165 |
\&\f(CWchr($Name2character_number{$name})\fR, because the strings are returned as |
| 166 |
native, and the numbers are returned as Unicode. |
| 167 |
However, for Perls starting with v5.8, \f(CWe2char($n)\fR is the same as |
| 168 |
\&\f(CW\*(C`chr(utf8::unicode_to_native(e2charnum($n)))\*(C'\fR, and ditto for |
| 169 |
\&\f(CW$Name2character{$name}\fR and |
| 170 |
\&\f(CW\*(C`chr(utf8::unicode_to_native($Name2character_number{$name}))\*(C'\fR. |
| 171 |
.SH "SEE ALSO" |
| 172 |
.IX Header "SEE ALSO" |
| 173 |
Pod::Browser \- a pod web server based on Catalyst. |
| 174 |
.PP |
| 175 |
Pod::Checker \- check pod documents for syntax errors. |
| 176 |
.PP |
| 177 |
Pod::Coverage \- check if the documentation for a module is comprehensive. |
| 178 |
.PP |
| 179 |
perlpod \- description of pod format (for people documenting with pod). |
| 180 |
.PP |
| 181 |
perlpodspec \- specification of pod format (for people processing it). |
| 182 |
.PP |
| 183 |
Text::Unidecode \- ASCII transliteration of Unicode text. |
| 184 |
.SH REPOSITORY |
| 185 |
.IX Header "REPOSITORY" |
| 186 |
<https://github.com/neilbowers/Pod\-Escapes> |
| 187 |
.SH "COPYRIGHT AND DISCLAIMERS" |
| 188 |
.IX Header "COPYRIGHT AND DISCLAIMERS" |
| 189 |
Copyright (c) 2001\-2004 Sean M. Burke. All rights reserved. |
| 190 |
.PP |
| 191 |
This library is free software; you can redistribute it and/or modify |
| 192 |
it under the same terms as Perl itself. |
| 193 |
.PP |
| 194 |
This program is distributed in the hope that it will be useful, but |
| 195 |
without any warranty; without even the implied warranty of |
| 196 |
merchantability or fitness for a particular purpose. |
| 197 |
.PP |
| 198 |
Portions of the data tables in this module are derived from the |
| 199 |
entity declarations in the W3C XHTML specification. |
| 200 |
.PP |
| 201 |
Currently (October 2001), that's these three: |
| 202 |
.PP |
| 203 |
.Vb 3 |
| 204 |
\& http://www.w3.org/TR/xhtml1/DTD/xhtml\-lat1.ent |
| 205 |
\& http://www.w3.org/TR/xhtml1/DTD/xhtml\-special.ent |
| 206 |
\& http://www.w3.org/TR/xhtml1/DTD/xhtml\-symbol.ent |
| 207 |
.Ve |
| 208 |
.SH AUTHOR |
| 209 |
.IX Header "AUTHOR" |
| 210 |
Sean M. Burke \f(CW\*(C`[email protected]\*(C'\fR |
| 211 |
.PP |
| 212 |
Now being maintained by Neil Bowers <[email protected]> |