From 78fde6f71a6b33f64612e26373dbad0d76398eb5 Mon Sep 17 00:00:00 2001 From: Vlasta Vesely Date: Sun, 2 May 2021 21:14:56 +0200 Subject: [PATCH] velthuis: encode ZWJ and ZWNJ --- tests/velthuis.c | 11 +++++++++++ velthuis.c | 4 +++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/tests/velthuis.c b/tests/velthuis.c index 30e7b20..d16acb6 100644 --- a/tests/velthuis.c +++ b/tests/velthuis.c @@ -39,8 +39,19 @@ START_TEST(test_encode_iast_to_velthuis) } END_TEST +START_TEST(test_encode_zwnj_and_zwj) +{ + test_encoding_to_iast("ka+i", "ka\u200di"); + test_encoding_to_velthuis("ka\u200di", "ka+i"); + + test_encoding_to_iast("ka_i", "ka\u200ci"); + test_encoding_to_velthuis("ka\u200ci", "ka_i"); +} +END_TEST + void register_velthuis_encoder_tests(TCase *test_case) { tcase_add_test(test_case, test_encode_velthuis_to_iast); tcase_add_test(test_case, test_encode_iast_to_velthuis); + tcase_add_test(test_case, test_encode_zwnj_and_zwj); } diff --git a/velthuis.c b/velthuis.c index ab5bc35..140c6bb 100644 --- a/velthuis.c +++ b/velthuis.c @@ -34,7 +34,9 @@ static const struct encoder_tuple table[] = { {".n", "\u1e47"}, {".N", "\u1e46"}, {".s", "\u1e63"}, {".S", "\u1e62"}, - {"/", "m\u0310"}, {".a", "'"} + {"/", "m\u0310"}, {".a", "'"}, + {"_", "\u200c"}, /* ZWNJ */ + {"+", "\u200d"} /* ZWJ */ }; static const struct encoder_tuple *find_tuple(const char *text)