From 78d2b239c853236c082a9cddc4027ade5ba49de5 Mon Sep 17 00:00:00 2001 From: Kelly Brazil Date: Tue, 26 Apr 2022 17:51:30 -0700 Subject: [PATCH] doc update --- CHANGELOG | 3 +++ README.md | 3 +++ docs/utils.md | 12 ++++++++++++ man/jc.1 | 2 ++ templates/manpage_template | 2 ++ templates/readme_template | 3 +++ 6 files changed, 25 insertions(+) diff --git a/CHANGELOG b/CHANGELOG index 97d8dc8a..e57c6938 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -3,6 +3,9 @@ jc changelog 20220426 v1.18.8 - Fix UnicodeEncodeError on some systems where LANG=C is set and unicode characters are in the output +- Update history parser: do not drop non-ASCII characters if the system + is configured for UTF-8 encoding +- Enhance "magic syntax" to always use UTF-8 encoding 20220425 v1.18.7 - Add git log command parser diff --git a/README.md b/README.md index 5b3ecf61..2a061f56 100644 --- a/README.md +++ b/README.md @@ -425,6 +425,9 @@ or by exporting to the environment before running commands: $ export LANG=C ``` +On some older systems UTF-8 output will be downgraded to ASCII with `\\u` +escape sequences if the `C` locale does not support UTF-8 encoding. + #### Timezones Some parsers have calculated epoch timestamp fields added to the output. Unless diff --git a/docs/utils.md b/docs/utils.md index b400bcbd..5677d42e 100644 --- a/docs/utils.md +++ b/docs/utils.md @@ -1,6 +1,7 @@ # Table of Contents * [jc.utils](#jc.utils) + * [asciify](#jc.utils.asciify) * [warning\_message](#jc.utils.warning_message) * [error\_message](#jc.utils.error_message) * [compatibility](#jc.utils.compatibility) @@ -18,6 +19,17 @@ jc - JSON Convert utils + + +### asciify + +```python +def asciify(string: str) -> str +``` + +Return a string downgraded from Unicode to ASCII with some simple +conversions. + ### warning\_message diff --git a/man/jc.1 b/man/jc.1 index ff873a10..e408b763 100644 --- a/man/jc.1 +++ b/man/jc.1 @@ -686,6 +686,8 @@ or by exporting to the environment before running commands: $ export LANG=C .RE +On some older systems UTF-8 output will be downgraded to ASCII with `\\u` escape sequences if the \fBC\fP locale does not support UTF-8 encoding. + \fBTimezones:\fP Some parsers have calculated epoch timestamp fields added to the output. Unless a timestamp field name has a \fB_utc\fP suffix it is considered naive. (i.e. based on the local timezone of the system the \fBjc\fP parser was run on). If a UTC timezone can be detected in the text of the command output, the timestamp will be timezone aware and have a \fB_utc\fP suffix on the key name. (e.g. \fBepoch_utc\fP) No other timezones are supported for aware timestamps. diff --git a/templates/manpage_template b/templates/manpage_template index 43c6b585..c61ad7e1 100644 --- a/templates/manpage_template +++ b/templates/manpage_template @@ -201,6 +201,8 @@ or by exporting to the environment before running commands: $ export LANG=C .RE +On some older systems UTF-8 output will be downgraded to ASCII with `\\u` escape sequences if the \fBC\fP locale does not support UTF-8 encoding. + \fBTimezones:\fP Some parsers have calculated epoch timestamp fields added to the output. Unless a timestamp field name has a \fB_utc\fP suffix it is considered naive. (i.e. based on the local timezone of the system the \fBjc\fP parser was run on). If a UTC timezone can be detected in the text of the command output, the timestamp will be timezone aware and have a \fB_utc\fP suffix on the key name. (e.g. \fBepoch_utc\fP) No other timezones are supported for aware timestamps. diff --git a/templates/readme_template b/templates/readme_template index a5df7a6d..3176712e 100644 --- a/templates/readme_template +++ b/templates/readme_template @@ -328,6 +328,9 @@ or by exporting to the environment before running commands: $ export LANG=C ``` +On some older systems UTF-8 output will be downgraded to ASCII with `\\u` +escape sequences if the `C` locale does not support UTF-8 encoding. + #### Timezones Some parsers have calculated epoch timestamp fields added to the output. Unless