Hi, I love exporting terminal output of konsole as html but the result is always broken as soon as a special character is part of the output. ## How to reproduce 1. Open Konsole 2. Write command lines that output special characters (eg. 'tree' is good for that) 3. Export the output as HTML (File → Save Output As and select an html file format). 4. Host your HTML file, and open it in Firefox. ## Result: The special characters are corrupted, and random glyph appears. Example: https://peppercarrot.com/extras/forum/2025-02-21_konsole-default-html-output.html ( screenshot: https://peppercarrot.com/extras/forum/2025-02-21_screenshot_122028_net.jpg ) ## Expectation It should looks like what I had in konsole, like that: https://peppercarrot.com/extras/forum/2025-02-21_screenshot_123118_net.jpg ## Workaround I saw the html output file don't have any header, or set any charsets. If one manually edit the html output file with Kate, and insert at the start of the file: ``` <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> </head> ``` Then the output will be readable again. Here is an example: https://peppercarrot.com/extras/forum/2025-02-21_konsole-default-html-output_FIXED.html Too bad this workaround is tedious to do over and over again, I would appreciate an automatic way to get this (or another fix) to read and transmit my HTML output correctly. Thank you.
The page looks OK in Brave and Firefox here. I wonder if it font related. I don't recall why we don't add the DOCTYPE. I'll look at it.
A possibly relevant merge request was started @ https://invent.kde.org/utilities/konsole/-/merge_requests/1089
Git commit 7ef31a797717bf1a86304f8aa18c68ace85d7afe by Christoph Cullmann. Committed on 13/04/2025 at 12:22. Pushed by cullmann into branch 'master'. wrap output it html document & body ensure right encoding is set M +8 -0 src/autotests/TerminalCharacterDecoderTest.cpp M +13 -0 src/decoders/HTMLDecoder.cpp https://invent.kde.org/utilities/konsole/-/commit/7ef31a797717bf1a86304f8aa18c68ace85d7afe
Thank you very much!