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:
@@ -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)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user