Add utf8::character_start function

This commit is contained in:
Maxime Coste 2013-02-26 14:05:51 +01:00
parent 9b3bc8523b
commit 7865223587

View File

@ -81,6 +81,15 @@ bool is_character_start(Iterator it)
return (*it & 0xC0) != 0x80;
}
// returns an iterator to the first byte of the character it is into
template<typename Iterator>
Iterator character_start(Iterator it)
{
while (not is_character_start(it))
--it;
return it;
}
namespace InvalidBytePolicy
{