5

I can't figure out how to get apostrophes displaying correctly in my Perl documentation. For example, the text 'test' displays as âtestâ.

  • E<39> also renders as â
    • also I<'>
    • also S<'>
    • also E<apos>
  • C<'> renders as "'" (so apparently the terminal isn't the problem)
  • F<'> renders as underlined â

I've also tried running perldoc with -T, -n nroff and -n troff but none made a difference. Running with -t fixed the apostrophe problem but also kills all other text attributes.

I've been putting up with this for a while, but it's really starting to irritate me. How can I get them displayed correctly?

Jonas
  • 121,568
  • 97
  • 310
  • 388
Brad Mace
  • 27,194
  • 17
  • 102
  • 148
  • 4
    The problem is that perldoc is based on `nroff`, and these characters do not map to themselves. In nroff, you can use ``\`` as replacement to get these characters. See [perldoc renders incorrectly](https://bugzilla.redhat.com/show_bug.cgi?id=431041) – hwnd Aug 11 '13 at 22:11

3 Answers3

0

@hwnd's bug report led me to the LANG environment variable. By changing it from en_US.UTF-8 to en_US I can get the perldocs displaying correctly. Not sure if this will cause problems elsewhere but so far I haven't run into any.

Brad Mace
  • 27,194
  • 17
  • 102
  • 148
  • This is what I ended up doing as well. As stated elsewhere, the issue is the discrepancy in encoding of certain characters and the various programs perldoc uses to format and render the pod. – Phil DD Nov 19 '15 at 16:39
0

Upgrade Pod::Perldoc and use the -o term backend.

daxim
  • 39,270
  • 4
  • 65
  • 132
0

can't say i know lots about this issue, but this has worked for me in the past when characters don't appear correctly:

binmode(STDOUT, "utf-8");

Jarett Lloyd
  • 125
  • 1
  • 8