summaryrefslogtreecommitdiffstats
path: root/regex.h
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2015-08-10 19:57:35 -0700
committerKaz Kylheku <kaz@kylheku.com>2015-08-10 19:57:35 -0700
commitd36002e99bd8c844a0f1abdc26e66be7f94409b4 (patch)
tree9658e92e45356b20003e1d66567e416f99d0f01a /regex.h
parent7d962e011cbb56d33d2874ad12205ecea68a7191 (diff)
downloadtxr-d36002e99bd8c844a0f1abdc26e66be7f94409b4.tar.gz
txr-d36002e99bd8c844a0f1abdc26e66be7f94409b4.tar.bz2
txr-d36002e99bd8c844a0f1abdc26e66be7f94409b4.zip
Count East Asian Wide and Full Fidth chars as two columns.
* regex.c (create_wide_cs): New static function. (wide_display_char_p): New function. * regex.h (wide_display_char_p): Declared. * stream.c (put_string, put_char): Use wide_display_char_p to determine whether an extra column need be counted. Also bugfix: iswprint evidently cannot be relied to work over the entire Unicode range, at least not in the C locale. Glibc's version and is reporting valid Japanese characters as unprintable on Ubuntu. As a hack we instead check for control characters and invert the result: control chars are unprintable. * tests/009/json.expected: Updated.
Diffstat (limited to 'regex.h')
-rw-r--r--regex.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/regex.h b/regex.h
index 90695a1d..1aaa521b 100644
--- a/regex.h
+++ b/regex.h
@@ -39,5 +39,5 @@ val search_regst(val haystack, val needle_regex, val start_num, val from_end);
val match_regst(val str, val regex, val pos);
val match_regst_right(val str, val regex, val end);
val regsub(val regex, val repl, val str);
-
+int wide_display_char_p(wchar_t ch);
void regex_init(void);