Created
October 23, 2016 06:34
-
-
Save ufcpp/84c61d0d2447a35d6c0c2b24914faea9 to your computer and use it in GitHub Desktop.
zero width joiner is ignored in identifiers
This file contains 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; | |
class Program | |
{ | |
static void Main() | |
{ | |
var ab = 0; | |
a\u200db = 1; // なぜか ab と同じ扱い。\u200d は zero witdh joiner | |
Console.WriteLine(ab); // 1 | |
var s1 = "ab"; | |
var s2 = "a\u200db"; | |
Console.WriteLine(s1.Length); // 2 | |
Console.WriteLine(s2.Length); // 3 | |
Console.WriteLine(s1 == s2); // false | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment