TextArea string editor has started converting whitespaces to nbsp's after some update. It happens if there are more than one whitespace in a row, the latter one's are replaced with nbsp's (charcode 160). Perhaps a nice feature if you'r using the strings only on your views, but not so nice when you'r using them for embedded html or system configuration.
I think it's a terrible change and should be reverted to save the text as it was written. But meanwhile I'd be happy to know if there are nice and clean workarounds.
[UIHint(UIHint.LongString)] doesn't work either.
So this happens when you use [UIHint(UIHint.Textarea)] ?
Yes. And with [UIHint(UIHint.LongString)] too.
Hi, any solution to this "error" yet?
I created a string extension method to workaround the issue. It's used on views like @Html.Raw(Model.Html.FixNbsp())
public static class StringExtensions
public static string FixNbsp(this string str)
// TextArea string editor converts whitespaces to nbsp's after some update.
// It happens if there are more than one whitespace in a row, the latter one's are replaced with nbsp's (charcode 160).
const char nbspChar = '\u00A0';
return !string.IsNullOrEmpty(str) ? str.Replace(nbspChar, ' ') : string.Empty;
Not nice, but works for now.