#474 – You Can Include Unicode Characters in Your Source Code

You can enter Unicode characters directly into your source code using the editor in Visual Studio.  These characters will be stored and intepreted correctly, if contained in a comment or a string literal.  (Unicode characters are not used in any C# keywords).

You can also enter a hex code for the Unicode character, rather than entering the character directly.  (E.g. By copying/pasting it or entering from a keyboard that includes the character)

        static void Main()
        {
            string money = "€";
            string sameThing = "\u20AC";
        }

Advertisements

About Sean
Software developer in the Twin Cities area, passionate about software development and sailing.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: