diff --git a/src/string.cc b/src/string.cc index c79b76c..faaadc2 100644 --- a/src/string.cc +++ b/src/string.cc @@ -57,6 +57,10 @@ namespace detail { if ((ret > MaxCodepoint) || (ret <= ulim[n])) { return false; } + /* invalid sequence - surrogate code point */ + if ((ret & 0xD800) == 0xD800) { + return false; + } cret = ret; r = sr; return true;