是否可以在 C# 控制台应用程序中获得版权符号? [英] Is it possible to get a copyright symbol in C# Console application?

查看:21
本文介绍了是否可以在 C# 控制台应用程序中获得版权符号?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以在 C# 控制台应用程序中以任何方式添加版权符号或其他特殊"符号?

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

推荐答案

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

完美地为我工作.无论控制台窗口设置为光栅字体还是 Unicode.

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

如果要输出 Unicode,应将控制台输出编码设置为 UTF-8 或 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;

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");

这篇关于是否可以在 C# 控制台应用程序中获得版权符号?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆