[HarfBuzz] language-code issues

Behdad Esfahbod behdad at behdad.org
Thu Apr 29 00:32:28 PDT 2010

On 04/28/2010 08:13 PM, Jonathan Kew wrote:
> I've run across a couple of things that seem wrong in the language code support (harfbuzz-ng).
> (1) hb_language_from_string() fails to increment num_langs when it allocates a new language code, so it never actually remembers what it has allocated!

Fixed.  Thanks.

> (2) In hb_ot_tag_to_language(), I'm wondering whether the temporary string that is created is guaranteed to be correctly null-terminated? I'm a bit hazy on the precise array initialization rules, so I added an explicit zero to be safe:

It was safe.  Made it explicit however.

> More seriously, I'm confused by the "ot:TAG" string that potentially gets constructed here and passed to hb_language_from_string. It looks to me as though the use of canon_map there will in effect map the ":" to a null byte, and so the string will be treated as if it were simply "ot". This seems broken, AFAICS.

Fixed by using BCP47 Private Use language tags of the form "x-hbotTAG ".


More information about the HarfBuzz mailing list