marky

Lightweight bookmarking + plaintext archive
Log | Files | Refs | README | LICENSE

commit 49caf6290d92e0bd475f7ad1441364ec1f0ef618
parent ba381a0d8736414280ff50d3f5bdee45ba5d5e97
Author: David Eisinger <[email protected]>
Date:   Mon, 13 Oct 2025 00:18:20 -0400

Fix w3m/Linux/UTF-8 issue

Diffstat:
Minternal/archiver.go | 3++-
1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/internal/archiver.go b/internal/archiver.go @@ -80,7 +80,8 @@ func IsHTMLURL(ctx context.Context, rawURL string) bool { // w3mDump runs `w3m -dump` to render the given URL to plaintext. func w3mDump(ctx context.Context, url string) (string, error) { - cmd := exec.CommandContext(ctx, "w3m", "-dump", "-T", "text/html", "-o", "display_link_number=1", url) + // Force UTF-8 output to avoid mojibake on systems with non-UTF locales. + cmd := exec.CommandContext(ctx, "w3m", "-dump", "-T", "text/html", "-O", "UTF-8", "-o", "display_link_number=1", url) // Keep environment as-is; rely on user PATH. Capture stdout only. b, err := cmd.Output() if err != nil {