Making apostrophes render correctly in perldoc

260 Views Asked by At

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?

3

There are 3 best solutions below

1
On

@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.

0
On

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

0
On

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");