public static uint ToUtf32(ushort leadingSurrogate, ushort trailingSurrogate) { if (!Utf16.IsLeadingSurrogate(leadingSurrogate)) { throw InvalidLeadingSurrogate(leadingSurrogate); } if (!Utf16.IsTrailingSurrogate(trailingSurrogate)) { throw InvalidTrailingSurrogate(trailingSurrogate); } return(CombineSurrogates(leadingSurrogate, trailingSurrogate)); }
public static bool IsInvalid(uint value) { return(((value & 0xFFFE) == 0xFFFE) || (Utf16.IsSurrogate(value)) || (value >= NonCharacterStart && value <= NonCharacterEnd)); }