Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
// handles 1 or 2 surrogates
case state::u_surr:
{
if(u0_ == -1)
{
if( u_ >= 0xd800 &&
u_ < 0xe000)
{
// need 2nd surrogate
u0_ = u_;
stack_.front() = state::u_pair1;
goto loop;
}
// emit {u_} as utf8
stack_.pop_front();
goto loop;
}
// emit {u0_, u_} as utf8
unsigned long cp =
(u0_ - 0xd800) << 10;
if(u_ - 0xdc00
u0_ = -1;
stack_.pop_front();
goto loop;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.