C# Language Using escape sequences in identifiers


Example

Escape sequences are not restricted to string and char literals.

Suppose you need to override a third-party method:

protected abstract IEnumerable<Texte> ObtenirŒuvres();

and suppose the character Πis not available in the character encoding you use for your C# source files. You are lucky, it is permitted to use escapes of the type \u#### or \U######## in identifiers in the code. So it is legal to write:

protected override IEnumerable<Texte> Obtenir\u0152uvres()
{
    // ...
}

and the C# compiler will know Πand \u0152 are the same character.

(However, it might be a good idea to switch to UTF-8 or a similar encoding that can handle all characters.)