Stricter UTF-8, so ascii characters can't get encoded as multi-bytes and pass validations

develop
kaetemi 4 years ago
parent 66ef424af0
commit 14da4d1e61

@ -287,6 +287,12 @@ u32char CUtfStringView::utf8Iterator(const void **addr)
// Replacement character <20>
return 0xFFFD;
}
else if (c0 < 0x10000)
{
// Invalid encoding
// Replacement character <20>
return 0xFFFD;
}
}
else
{
@ -320,6 +326,12 @@ u32char CUtfStringView::utf8Iterator(const void **addr)
// Replacement character <20>
return 0xFFFD;
}
else if (c0 < 0x0800)
{
// Invalid encoding
// Replacement character <20>
return 0xFFFD;
}
}
else
{
@ -327,6 +339,12 @@ u32char CUtfStringView::utf8Iterator(const void **addr)
return 0xFFFD;
}
}
else if (c0 < 0x80)
{
// Invalid encoding
// Replacement character <20>
return 0xFFFD;
}
}
else
{

Loading…
Cancel
Save