You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Change isFOO_utf8_safe macros to return matched byte length
Or 0 when the character isn't of type FOO. This allows these macros to
be used as booleans, as previously; or to give you how many bytes there
are in the matched UTF-8 character.
This was always trivially the case for ASCII-range characters, as the
former boolean 0,1 gave you the correct length if they matched.
The previous commit extended this to return the length for above-Latin1
characters.
This commit is the final piece. Latin1 characters that aren't ASCII
always are two bytes. So just multiply the return by 2, yielding 0 if
no match or 2 bytes if matched.
0 commit comments