From d36002e99bd8c844a0f1abdc26e66be7f94409b4 Mon Sep 17 00:00:00 2001 From: Kaz Kylheku <kaz@kylheku.com> Date: Mon, 10 Aug 2015 19:57:35 -0700 Subject: 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. --- tests/009/json.expected | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'tests/009/json.expected') diff --git a/tests/009/json.expected b/tests/009/json.expected index eea65fb8..4e80c58f 100644 --- a/tests/009/json.expected +++ b/tests/009/json.expected @@ -46,8 +46,8 @@ AST: #("JSON Test Pattern pass1" #H((:equal-based) ("object with 1 member" #("ar ("address" "50 St. James Street") ("compact" #(1.0 2.0 3.0 4.0 5.0 6.0 7.0)) ("object" #H((:equal-based))) ("quote" "\"") ("jsontext" "{\"object with 1 member\":[\"array with 1 element\"]}") ("true" :true) ("integer" 1234567890.0) ("ALPHA" "ABCDEFGHIJKLMNOPQRSTUVWYZ") - ("quotes" "" \" %22 0x22 034 "") ("hex" "ģ䕧覫췯ꯍ") ("0123456789" "digit") - ("controls" "\b\f\n\r\t") ("alpha" "abcdefghijklmnopqrstuvwyz") + ("quotes" "" \" %22 0x22 034 "") ("hex" "ģ䕧覫췯ꯍ") + ("0123456789" "digit") ("controls" "\b\f\n\r\t") ("alpha" "abcdefghijklmnopqrstuvwyz") (" s p a c e d " #(1.0 2.0 3.0 4.0 5.0 6.0 7.0))) 0.5 98.6 99.44 1066.0 10.0 1.0 0.1 1.0 2.0 2.0 "rosebud") -- cgit v1.2.3