We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 7d7a3c9 commit 8a81e3aCopy full SHA for 8a81e3a
src/Mvc/Mvc.ViewFeatures/test/StringHtmlContentTest.cs
@@ -2,6 +2,7 @@
2
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
3
4
using System.IO;
5
+using System.Text.Encodings.Web;
6
using Microsoft.Extensions.WebEncoders.Testing;
7
using Xunit;
8
@@ -22,5 +23,19 @@ public void WriteTo_WritesContent()
22
23
Assert.Equal("HtmlEncode[[Hello World]]", writer.ToString());
24
}
25
26
+
27
+ [Fact]
28
+ public void Emoji_EncodedCorrectly()
29
+ {
30
+ // Arrange & Act
31
+ var tearsOfJoy = new StringHtmlContent("😂2");
32
33
+ // Assert
34
+ using (var stringWriter = new StringWriter())
35
36
+ tearsOfJoy.WriteTo(stringWriter, HtmlEncoder.Default);
37
+ Assert.Equal("😂2", stringWriter.ToString(), ignoreCase: true);
38
+ }
39
40
41
0 commit comments