diff --git a/src/Orchard/ContentManagement/XmlHelper.cs b/src/Orchard/ContentManagement/XmlHelper.cs
index 75f13d462..2e9bfce70 100644
--- a/src/Orchard/ContentManagement/XmlHelper.cs
+++ b/src/Orchard/ContentManagement/XmlHelper.cs
@@ -153,7 +153,7 @@ namespace Orchard.ContentManagement {
/// The string representation of the value.
public static string ToString(T value) {
var type = typeof(T);
- if (type == typeof(string)) {
+ if (type == typeof(string) || type == typeof(char)) {
return Convert.ToString(value);
}
if ((!type.IsValueType || Nullable.GetUnderlyingType(type) != null) &&
@@ -250,6 +250,9 @@ namespace Orchard.ContentManagement {
if (type == typeof(double)) return (T)(object)double.NegativeInfinity;
throw new NotSupportedException(String.Format("Infinity not supported for type {0}", type.Name));
}
+ if (type == typeof(char) || type == typeof(char?)) {
+ return (T)(object)char.Parse(value);
+ }
if (type == typeof(int) || type == typeof(int?)) {
return (T)(object)int.Parse(value, CultureInfo.InvariantCulture);
}
@@ -356,4 +359,4 @@ namespace Orchard.ContentManagement {
}
}
}
-}
\ No newline at end of file
+}