;fix:doc: more text encoding corrections (#2394)

This commit is contained in:
Simon Michael 2025-05-30 12:11:15 -10:00
parent d679098cfe
commit b7dbe3ed4f
3 changed files with 12 additions and 19 deletions

View File

@ -101,14 +101,11 @@ In a powershell window (press `WINDOWS-R`, `powershell`, `ENTER`):
hledger --version; hledger-ui --version; hledger-web --version # should show refs/tags/1.42.99; if not, check why: where.exe hledger hledger --version; hledger-ui --version; hledger-web --version # should show refs/tags/1.42.99; if not, check why: where.exe hledger
``` ```
3. Ensure a default journal file exists, and without a problematic encoding. 3. Ensure a default journal file exists, and without a problematic encoding (I'm not sure if/why "ascii" was needed here).
This will allow you to start hledger-web by double-clicking on its icon if you wish. This will allow you to start hledger-web by double-clicking on its icon if you wish.
``` ```
out-file -append -encoding ascii $HOME/.hledger.journal out-file -append -encoding ascii $HOME/.hledger.journal
``` ```
(I'm not sure why "ascii" is needed here - hledger likes utf8 and understands utf8 BOM headers,
but the state of [our unicode support on Windows](https://github.com/simonmichael/hledger/issues?q=is%3Aissue+label%3A%22platform%3A+windows%22+label%3Ai18n)
is really unknown, your feedback is welcome.)
</xdetails> </xdetails>
<xdetails> <xdetails>

View File

@ -882,8 +882,8 @@ $ hledger -f examples/bcexample.hledger bal assets:us:etrade -3 -Y -O csv --layo
### Balance report output ### Balance report output
As noted in [Output format](#output-format), As noted in [Output format](#output-format),
if you choose HTML output (by using `-O html` or `-o somefile.html`), it will use the UTF-8 text encoding, if you choose HTML output (by using `-O html` or `-o somefile.html`),
And you can create a `hledger.css` file in the same directory to customise the report's appearance. you can create a `hledger.css` file in the same directory to customise the report's appearance.
The HTML and [FODS] output formats can generate hyperlinks to a `hledger-web` register view for each account and period. The HTML and [FODS] output formats can generate hyperlinks to a `hledger-web` register view for each account and period.
E.g. if your `hledger-web` server is reachable at `http://localhost:5000` E.g. if your `hledger-web` server is reachable at `http://localhost:5000`

View File

@ -430,15 +430,12 @@ forms, etc.)
This requires a well-configured environment. Here are some tips: This requires a well-configured environment. Here are some tips:
- A system locale must be configured, and it must be one that can - A system locale must be configured, which can decode the characters being used.
decode the characters being used. This is essential - see [Text encoding](#text-encoding).
In bash, you can set a locale like this: `export LANG=en_US.UTF-8`.
There are some more details in [Troubleshooting](#troubleshooting).
This step is essential - without it, hledger will quit on encountering
a non-ascii character (as with all GHC-compiled programs).
- Your terminal software (eg Terminal.app, iTerm, CMD.exe, xterm..) must support unicode. - Your terminal software (eg Terminal.app, iTerm, CMD.exe, xterm..) must support unicode.
On Windows, you may need to use Windows Terminal and/or enable UTF-8 support. On Windows, you may need to use Windows Terminal and/or enable UTF-8 support system-wide -
see [Install: Locale](install.md#locale).
- The terminal must be using a font which includes the required unicode glyphs. - The terminal must be using a font which includes the required unicode glyphs.
@ -3272,14 +3269,12 @@ See also ["Working with CSV > Reading files specified by rule"](#reading-files-s
encoding ENCODING encoding ENCODING
``` ```
hledger normally expects non-ascii text to be UTF8-encoded. hledger normally expects non-ascii text to be using the system locale's text encoding.
If you need to read CSV files which have some other encoding, If you need to read CSV files which have some other encoding,
you can do it by adding `encoding ENCODING` to your CSV rules. you can do it by adding `encoding ENCODING` to your CSV rules.
Eg: `encoding iso-8859-1`. Eg: `encoding iso-8859-1`.
The following encodings are supported The following encodings are supported:
(some alternate names and spellings also work, but [inconsistently](https://github.com/dmwit/encoding/issues/28))
:
`ascii`, `ascii`,
`utf-8`, `utf-8`,
@ -7000,8 +6995,9 @@ 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 UTF-8-aware system locale must be configured to work with non-ascii data. A system locale with a text encoding must be configured to work with non-ascii data.
(See Unicode characters, Troubleshooting.) hledger should try UTF-8 if no encoding is configured.
(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
and how you installed hledger, and how you installed hledger,