System.Runtime.Serialization.Json.XmlJsonWriter.IsUnicodeNewlineCharacter C# (CSharp) Method

IsUnicodeNewlineCharacter() private static method

private static IsUnicodeNewlineCharacter ( char c ) : bool
c char
return bool
        private static bool IsUnicodeNewlineCharacter(char c)
        {
            // Newline characters in JSON strings need to be encoded on the way out (DevDiv #665974)
            // See Unicode 6.2, Table 5-1 (http://www.unicode.org/versions/Unicode6.2.0/ch05.pdf]) for the full list.

            // We only care about NEL, LS, and PS, since the other newline characters are all
            // control characters so are already encoded.
            return (c == '\u0085' || c == '\u2028' || c == '\u2029');
        }