Skip to content

Instantly share code, notes, and snippets.

@dylanbeattie
Created August 7, 2020 16:44
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dylanbeattie/336b6b8990f0db6dd00d238ad114092a to your computer and use it in GitHub Desktop.
Save dylanbeattie/336b6b8990f0db6dd00d238ad114092a to your computer and use it in GitHub Desktop.
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);
}
}
}
@csharpforevermore
Copy link

Just been watching the NDC { Oslo } show about "plain" text. Very interesting and enlightening.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment