diff --git a/src/hb-ot-tag.cc b/src/hb-ot-tag.cc index 5dd005fb1..07ae3103b 100644 --- a/src/hb-ot-tag.cc +++ b/src/hb-ot-tag.cc @@ -845,7 +845,7 @@ hb_ot_tag_from_language (hb_language_t language) { const LangTagLong *lang_tag; lang_tag = &ot_languages_zh[i]; - if (lang_matches (lang_tag->language, lang_str)) + if (lang_matches (lang_str, lang_tag->language)) return lang_tag->tag; } diff --git a/test/api/test-ot-tag.c b/test/api/test-ot-tag.c index 1897180db..65290179a 100644 --- a/test/api/test-ot-tag.c +++ b/test/api/test-ot-tag.c @@ -195,6 +195,7 @@ test_ot_tag_language (void) test_language_two_way ("ZHH", "zh-hk"); /* Chinese (Hong Kong) */ + test_tag_from_language ("ZHS", "zh"); /* Chinese */ test_tag_from_language ("ZHS", "zh-cn"); /* Chinese (China) */ test_tag_from_language ("ZHS", "zh-sg"); /* Chinese (Singapore) */ test_tag_from_language ("ZHT", "zh-mo"); /* Chinese (Macao) */