redhataccess / ascii_binder

AsciiBinder is an AsciiDoc-based system for authoring and publishing closely related documentation sets from a single source.
https://asciibinder.net
MIT License
76 stars 39 forks source link

ascii_binder does not respect the system locale #177

Open fzdarsky opened 1 year ago

fzdarsky commented 1 year ago

When running asciibinder build (v1.0.1) against content using UTF8 encoding, the build fails with the error

Error: Could not generate docs:
Encoding::InvalidByteSequenceError: /path/to/document_with_utf8.html.erb is not valid US-ASCII at
[...]

When running it with LC_ALL=C.UTF-8 asciibinder build it builds correctly.

The system in question (a fresh RHEL8.7 install, but also happens on OSX12.6.1) has a locale of

LANG=en_US.UTF-8
LC_CTYPE=UTF-8
[...]
LC_ALL=

When the override LC_ALL is empty (as is normal), the application should have fallen back to respect LC_CTYPE, then LANG.

It would be great to document this behaviour until the issue is fixed.

vikram-redhat commented 1 year ago

Hi @fzdarsky - thanks for this. That is a good catch.

I don't maintain this repo actively anymore. Hoping someone else can take a look.

If you are able to, feel free to submit a PR against the docs repo to document this: https://github.com/redhataccess/ascii_binder-docs