dotnet/roslyn

Roslyn rejects \U unicode characters in identifiers

Open

#13,560 建立於 2016年9月2日

在 GitHub 查看
 (0 留言) (0 反應) (1 負責人)C# (4,257 fork)batch import
Area-CompilersBugLanguage-C#Tenet-Localizationhelp wanted

倉庫指標

Star
 (20,414 star)
PR 合併指標
 (平均合併 6天 17小時) (30 天內合併 256 個 PR)

描述

Roslyn rejects Unicode characters in the range U+10000 to U+10FFFF in identifiers. This is specifically called out as supported in the language specification, but does not work in the compilers. See https://msdn.microsoft.com/en-us/library/aa664669(v=vs.71).aspx . Here is a sample:

using System;
using System.Collections.Generic;
using System.Linq;

class Program
{
    public static void Main(string[] args)
    {
        int \U00020000 = 10; http://www.fileformat.info/info/unicode/char/20000/index.htm
        Console.WriteLine(\U00020000);
    }
}

See also #13474 and #9731, which report related errors when surrogate pairs (rather than Unicode escape sequences) appear in the input.

貢獻者指南