func isUTF16EncodedRune(r rune) bool {
	return highSurrogateOffset <= r && r <= basicMultilingualPlaneReservedOffset
}
isUTF16EncodedRune checks if a rune is in the range for non-BMP characters,
which is used to describe UTF16 chars.
Source: https://en.wikipedia.org/wiki/Plane_(Unicode)#Basic_Multilingual_Plane
package jsonparser
import (
	"bytes"
	"unicode/utf8"
)
const supplementalPlanesOffset = 0x10000
const highSurrogateOffset = 0xD800
const lowSurrogateOffset = 0xDC00
const basicMultilingualPlaneReservedOffset = 0xDFFF
const basicMultilingualPlaneOffset = 0xFFFF
func combineUTF16Surrogates(high, low rune) rune {
	return supplementalPlanesOffset + (high-highSurrogateOffset)<<10 + (low - lowSurrogateOffset)
}
const badHex = -1
func h2I(c byte) int {
	switch {
	case c >= '0' && c <= '9':
		return int(c - '0')
	case c >= 'A' && c <= 'F':
		return int(c - 'A' + 10)
	case c >= 'a' && c <= 'f':
		return int(c - 'a' + 10)
	}
	return badHex
}
func decodeSingleUnicodeEscape(in []byte) (rune, bool) {
	if len(in) < 6 {
		return utf8.RuneError, false
	}
	h1, h2, h3, h4 := h2I(in[2]), h2I(in[3]), h2I(in[4]), h2I(in[5])
	if h1 == badHex || h2 == badHex || h3 == badHex || h4 == badHex {
		return utf8.RuneError, false
	}
	return rune(h1<<12 + h2<<8 + h3<<4 + h4), true
}