When truncating if the last characters was the first half of a two word unicode character, also include the second half to avoid YSOD

This commit is contained in:
Lotte Pitcher
2016-11-03 14:30:38 +00:00
parent ef38808ba5
commit c8b23195f6

View File

@@ -211,6 +211,13 @@ namespace Umbraco.Web
if (!lengthReached && currentTextLength >= length)
{
// if the last character added was the first of a two character unicode pair, add the second character
if (Char.IsHighSurrogate((char)ic))
{
var lowSurrogate = tr.Read();
outputtw.Write((char)lowSurrogate);
}
// Reached truncate limit.
if (addElipsis)
{