Sometimes (but not always) the UTF-16 conversion inserts a BOM. Skip it.

This commit is contained in:
Chris Young 2014-06-01 08:44:51 +01:00
parent c7ba173a64
commit 3457d3adc7
1 changed files with 2 additions and 0 deletions

View File

@ -311,6 +311,8 @@ bool nsfont_split(const plot_font_style_t *fstyle,
*char_offset = 0;
*actual_x = 0;
if (*utf16 == 0xFEFF) utf16++;
while (utf8_pos < length) {
if ((*utf16 < 0xD800) || (0xDBFF < *utf16))
utf16next = utf16 + 1;