LINQPad 6.9.15 seems not using latest .NET Core 5.0 API
For following code:
void Main()
{
typeof(int).Assembly.Location.Dump();
PrintGraphemes("🤷🏽♀️");
}
static void PrintGraphemes(string str)
{
Console.WriteLine($"Printing graphemes of \"{str}\"...");
int i = 0;
TextElementEnumerator enumerator = StringInfo.GetTextElementEnumerator(str);
while (enumerator.MoveNext())
{
Console.WriteLine($"Grapheme {++i}: \"{enumerator.Current}\"");
}
Console.WriteLine($"({i} grapheme(s) total.)");
Console.WriteLine();
}
Latest Roslyn and .NET Core 5.0 preview was enabled in LINQPad settings:
Output from LINQPad 6.9.15 and Visual Studio 2019 is different:
Looks like it's not referenced to the latest change, please refer to this page:
https://docs.microsoft.com/en-us/dotnet/core/compatibility/3.1-5.0#stringinfo-and-textelementenumerator-are-now-uax29-compliant
Comments
-
The issue here is with the editor not handling those graphemes properly. This could be tricky to fix without a major upgrade to the editor, although it might still be done if there's sufficient demand.
