Created
August 7, 2020 16:44
-
-
Save dylanbeattie/336b6b8990f0db6dd00d238ad114092a to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Text; | |
namespace DotNetSummitBy { | |
class Program { | |
static NormalizationForm[] forms = new[] { | |
NormalizationForm.FormC, NormalizationForm.FormD, | |
NormalizationForm.FormKC, NormalizationForm.FormKD | |
}; | |
static void Compare(string s1, string s2) { | |
Console.WriteLine($"s1 == s2: {s1 == s2}"); | |
foreach (var form in forms) { | |
var result = s1.Normalize(form) == s2.Normalize(form); | |
Console.WriteLine($"{form}: {result}"); | |
} | |
} | |
static void Main(string[] args) { | |
Console.OutputEncoding = System.Text.Encoding.UTF8; | |
var s1 = "Ⓗⓔⓛⓛⓞ"; | |
var s2 = "Hello"; | |
Compare(s1, s2); | |
} | |
} | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Just been watching the NDC { Oslo } show about "plain" text. Very interesting and enlightening.