From fde6f5bd682f5ad0cc5e2ec69fc831b0192bf90b Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Thu, 29 Apr 2010 04:41:41 -0400 Subject: [PATCH] Convert to uppercase in hb_ot_tag_from_language() --- src/hb-ot-tag.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/hb-ot-tag.c b/src/hb-ot-tag.c index 40356b0bb..8b88eb3ea 100644 --- a/src/hb-ot-tag.c +++ b/src/hb-ot-tag.c @@ -599,8 +599,10 @@ hb_ot_tag_from_language (hb_language_t language) int i; lang_str += 6; i = 0; - while (i < 4 && lang_str[i]) { - tag[i] = lang_str[i]; +#define IS_LETTER(c) (((c) >= 'a' && (c) <= 'z') || ((c) >= 'A' && (c) <= 'Z')) +#define TO_UPPER(c) (((c) >= 'a' && (c) <= 'z') ? (c) + 'A' - 'a' : (c)) + while (i < 4 && IS_LETTER (lang_str[i])) { + tag[i] = TO_UPPER (lang_str[i]); } while (i < 4) tag[i] = ' ';