;fix:doc: more text encoding corrections/cleanups [#2394]

This commit is contained in:
Simon Michael 2025-06-02 23:48:27 -10:00
parent 925b85a65e
commit 2ad6f7f744

View File

@ -113,13 +113,10 @@ So, trying to read non-ascii files which have the wrong text encoding,
or when no system locale is configured, will fail. or when no system locale is configured, will fail.
To fix this, configure your system locale appropriately, To fix this, configure your system locale appropriately,
and/or convert the files to your system's text encoding (using `iconv` on unix, or powershell or notepad on Windows). and/or convert the files to your system's text encoding (using `iconv` on unix, or powershell or notepad on Windows).
See [Install: Text encoding](/install.md#text-encoding) for more tips.
hledger's output will use the system locale's encoding. hledger's output will use the system locale's encoding.
You may be able to override the system encoding for input or output temporarily, but it's platform-specific and can be tricky.
See <https://hledger.org/install#text-encoding> for more tips.
hledger's docs and example files mostly use UTF-8 encoding. hledger's docs and example files mostly use UTF-8 encoding.
## Data formats ## Data formats
@ -802,9 +799,9 @@ If these don't work well, you can set your preferred options in the `HLEDGER_LES
HTML output can be styled by an optional `hledger.css` file in the same directory. HTML output can be styled by an optional `hledger.css` file in the same directory.
HTML output will be UTF-8 encoded. If your web browser is showing junk characters, HTML output will be a HTML fragment, not a complete HTML document.
you may need to change its text encoding to UTF-8. Like other hledger output, for non-ascii characters it will use the system locale's text encoding
Eg in Safari, see View -> Text Encoding and Settings -> Advanced -> Default Encoding. (see [Text encoding](#text-encoding)).
### CSV / TSV output ### CSV / TSV output
@ -7010,8 +7007,7 @@ Some known issues and limitations:
The need to precede add-on command options with `--` when invoked from hledger is awkward. The need to precede add-on command options with `--` when invoked from hledger is awkward.
(See Command options, Constructing command lines.) (See Command options, Constructing command lines.)
A system locale with a text encoding must be configured to work with non-ascii data. A system locale with a suitable text encoding must be configured to work with non-ascii data.
hledger should try UTF-8 if no encoding is configured.
(See Text encoding, Troubleshooting.) (See Text encoding, Troubleshooting.)
On Microsoft Windows, depending whether you are running in a CMD window or a Cygwin/MSYS/Mintty window On Microsoft Windows, depending whether you are running in a CMD window or a Cygwin/MSYS/Mintty window
@ -7045,10 +7041,8 @@ and/or open a new terminal window.
A simple way is to close your terminal window and open a new one. A simple way is to close your terminal window and open a new one.
**Text decoding issues: I get errors like "Illegal byte sequence" or "Invalid or incomplete multibyte or wide character" or "commitAndReleaseBuffer: invalid argument (invalid character)"**\ **Text decoding issues: I get errors like "Illegal byte sequence" or "Invalid or incomplete multibyte or wide character" or "commitAndReleaseBuffer: invalid argument (invalid character)"**\
Programs compiled with GHC (hledger, GHC itself, all haskell build tools..) hledger usually needs non-ascii input to be decodable with the system locale's text encoding.
need the system to be configured with a suitable locale for decoding non-ascii text, See [Text encoding](#text-encoding) and [Install: Text encoding](/install.md#text-encoding).
or they will fail when they encounter such text.
See [Text encoding](#text-encoding) and <https://hledger.org/install>.
**COMPATIBILITY ISSUES: hledger gives an error with my Ledger file**\ **COMPATIBILITY ISSUES: hledger gives an error with my Ledger file**\
Not all of Ledger's journal file syntax or feature set is supported. Not all of Ledger's journal file syntax or feature set is supported.