lowdown icon indicating copy to clipboard operation
lowdown copied to clipboard

Incorrect percent encoding of unicode characters

Open sertonix opened this issue 9 months ago • 1 comments

When generating a manpage and a link contains a unicode characters the percent encoding sequences are invalid:

Running lowdown -s -T man test.md with this test.md

(The here is not an ascii character)

title: Test

[Text](./unicode‑on)

results in

.\" -*- mode: troff; coding: utf-8 -*-
.TH "Test" "7" ""
.PP
.UR ./unicode%FFFFFFE2%FFFFFF80%FFFFFF91hyphpon
Text
.UE

I noticed that some builds on other processor architectures have the correct output of %E2%80%91. Maybe there is some out of bounds memory access?

sertonix avatar Mar 21 '25 15:03 sertonix

Excellent point. This has also revealed a bad encoding when encountering spaces in URLs in -tman and -tms. Thank you! I'll have this fixed in the next release.

kristapsdz avatar Mar 30 '25 18:03 kristapsdz