Is it possible to get a copyright symbol in C# Console application?(是否可以在 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# 控制台应用程序中获得版权符号?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:是否可以在 C# 控制台应用程序中获得版权符号?
基础教程推荐
- 禁止输入少量字符,例如'<'、'&a 2022-01-01
- C# 从 List<List<int>> 中删除重 2022-01-01
- 当值可以是对象或空数组时反序列化 JSON 2022-01-01
- Moq It.Is<>不匹配 2022-01-01
- WPF 模态进度窗口 2022-01-01
- 如何使用 .Net 检查 Active Directory 服务器是否已启动并正在运行? 2022-01-01
- .NET SerialPort DataReceived 事件未触发 2022-01-01
- 我应该在后面的代码中直接使用 Linq To SQL 还是使 2022-01-01
- 如果有人提交恶意软件Nuget包怎么办? 2022-01-01
- Azure Functions:CosmosDBTrigger 未在 Visual Studio 中触发 2022-01-01
