Skip to content

VimHTML can double-encode UTF-8 when input is already decoded Perl text #2

Description

@mateu

I ran into a UTF-8 handling issue in Pod::Elemental::Transformer::VimHTML when highlighted input arrives as already-decoded Perl text.

In the failing case, content like guillemets in #!vim perl blocks can render as mojibake, for example «...» instead of «...».

The downstream fix that worked for me was:

  • normalize likely double-encoded-looking decoded input before passing it to Text::VimColor
  • avoid pre-encoding already-decoded Perl strings to octets
  • only decode HTML output if it is not already flagged as UTF-8
  • add an explicit use Carp qw(confess); import while touching the module

Downstream context:

If helpful, I can also put together a cleaner upstream-oriented PR from a fresh branch/repo shape. I wanted to at least report the bug and the working fix path first.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions