Implement ignore and UTF-8

This commit is contained in:
Mingye Wang
2021-04-20 09:52:40 +08:00
parent 69c7e86967
commit 8fd71febc6
5 changed files with 98 additions and 19 deletions

17
docs/LOCALE.md Normal file
View File

@@ -0,0 +1,17 @@
Locale Considerations
=====================
The editline library has basic support for locales via the use of the standard
POSIX functions `mbrtowc` and `wcwidth`. As a result, the on-screen width of
characters in printed text should be calculated correctly, the so-called
[East Asian ambiguous][] characters being a notable exception.
[East Asian ambiguous]: http://www.unicode.org/reports/tr11/tr11-38.html
The input handling is not yet multibyte-aware. Specifically, the presence of
non-self-synchonizing encodings requires always segmenting the whole string
using `mbrlen` when deleting.
Programs wishing to use the feature need to link to a build of `editline`
configured with `--enable-locale`. In addition, the program should call
`setlocale(LC_CTYPE, "")` to use the locale settings of the environment.