Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to get a copyright symbol in C# Console application?

Tags:

Is it possible to add a copyright symbol or other "special" symbol in any way in a C# console application?

like image 940
Patrik Björklund Avatar asked Mar 13 '09 22:03

Patrik Björklund


2 Answers

namespace test {   class test {     public static void Main() {       System.Console.WriteLine("©");     }   } } 

works for me flawlessly. Regardless of whether the console window is set to raster fonts or Unicode.

If you want to output Unicode, you should set the console output encoding to UTF-8 or Unicode.

System.Console.OutputEncoding = System.Text.Encoding.UTF8; 

or

System.Console.OutputEncoding = System.Text.Encoding.Unicode; 

And if you want to stay clear from source code encoding issues you should specify the character code point directly:

System.Console.WriteLine("\u00a9"); 
like image 85
Joey Avatar answered Nov 15 '22 13:11

Joey


You can copy it from here if you like:

©

(You can hold down ALT, then type 0169, then release the ALT key)

like image 45
Mark Ingram Avatar answered Nov 15 '22 11:11

Mark Ingram