Open thielema opened 1 month ago
That’s certainly surprising behaviour. Thanks for the report.
Since enabling this feature I’ve documented the logic in runPager. It’s probably still too weak at detecting when to use a pager (compared to our ansi colour detection, eg, which is aware of pipes).
There might also be a problem with loss of encoding when legitimately using a pager, it sounds like.
The following applies to hledger/HEAD (fa3676df7da0d18ede79a8fb87558d2ed6e81f8f).
I have a journal encoded in Latin-1. I can watch it like so:
Please note the umlaut "ö" in "Erlös".
Now, for short outputs the local encoding is respected, for long output is encoded in UTF-8, even if written to a file.
This is the expected result.
LANG=de_DE
switches to Latin-1 encoding for this one run ofhledger
.Now a longer output:
I think it is not a good idea to have different encodings depending on the output length. For piping to a file there should not be a pager involved, at all.
My preferred solution would be to always use the local encoding, as it was the case until now.