Skip to content

A non-ASCII fragment is double-encoded in a document with no charset #833

Description

@xroche

In a document that declares no charset, a reference like img src="s.svg#café" reaches the mirror with the fragment double-encoded: the UTF-8 bytes c3 a9 come out as c3 83 c2 a9, so the emitted fragment is #caf%C3%83%C2%A9 and the selector no longer matches.

This happens before the --single-file pass runs, and the mirrored control (a plain crawl, no --single-file) already contains the doubled bytes, so the encoding step is upstream of the inliner. Found while reviewing #804, whose fragment escaping faithfully encodes whatever it is handed and is not the cause.

Worth checking against the charset-detection path more generally, since the same double-encode would affect any non-ASCII text taken from a charset-less document, not just fragments.

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