-Added StringEscapeHandling with options to escape HTML and non-ASCII characters

-Added feature to deserialize ISet<T> properties as HashSet<T>
-Fixed ReferenceLoopHandling not being used when serializing ISerializable and dynamic values
This commit is contained in:
James Newton-King
2012-11-18 14:36:00 +13:00
parent f7018719d4
commit e3be3e43db
22 changed files with 515 additions and 38 deletions
+6 -3
View File
@@ -556,11 +556,14 @@ namespace Newtonsoft.Json
/// Converts the <see cref="String"/> to its JSON string representation.
/// </summary>
/// <param name="value">The value to convert.</param>
/// <param name="delimter">The string delimiter character.</param>
/// <param name="delimiter">The string delimiter character.</param>
/// <returns>A JSON string representation of the <see cref="String"/>.</returns>
public static string ToString(string value, char delimter)
public static string ToString(string value, char delimiter)
{
return JavaScriptUtils.ToEscapedJavaScriptString(value, delimter, true);
if (delimiter != '"' && delimiter != '\'')
throw new ArgumentException("Delimiter must be a single or double quote.", "delimiter");
return JavaScriptUtils.ToEscapedJavaScriptString(value, delimiter, true);
}
/// <summary>