From 018ba46e4d003a5dd0f6d2d899226129c4ef0c60 Mon Sep 17 00:00:00 2001 From: David Corbett Date: Fri, 23 Nov 2018 13:21:22 -0500 Subject: [PATCH] Don't canonicalize '@' to '-' in language tags Fixes #1406. --- src/hb-common.cc | 2 +- test/api/test-ot-tag.c | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/hb-common.cc b/src/hb-common.cc index 28b0c2b82..b7f9ad68b 100644 --- a/src/hb-common.cc +++ b/src/hb-common.cc @@ -204,7 +204,7 @@ static const char canon_map[256] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, '-', 0, 0, '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 0, 0, 0, 0, 0, 0, - '-', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', + 0, 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', 0, 0, 0, 0, '-', 0, 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', 0, 0, 0, 0, 0 diff --git a/test/api/test-ot-tag.c b/test/api/test-ot-tag.c index c0329bffc..82a57dc0b 100644 --- a/test/api/test-ot-tag.c +++ b/test/api/test-ot-tag.c @@ -449,6 +449,9 @@ test_ot_tag_language (void) /* A UN M.49 region code, not an extended language subtag */ test_tag_from_language ("ARA", "ar-001"); + + /* An invalid tag */ + test_tag_from_language ("TRK", "tr@foo=bar"); } static void