如何在 C# GUI 标签中显示日语字符
我正在用 C# 设计一个闪存卡程序,并且在使用 IME 输入的 SQL 紧凑数据库中有日语字符。这些字符在数据库中显示良好,但是当我将它们从数据库中拉出以显示在标签中时,我得到标准的“不知道要显示什么”框字符。
我正在从数据库中提取数据并将其转换为字符串。我确信有一个简单的解决办法,但我已经搜索过,但还没有偶然发现答案。我是否需要更改项目中某处的编码选项?如果有帮助的话我正在使用视觉工作室。
编辑:Winforms,很抱歉我的含糊不清。
I'm designing a flash card program in C#, and I have japanese characters in an SQL compact database entered using IME. The characters show up fine in the database, however when I pull them out of the database to display in a label, I get the standard 'don't know what to display' box characters.
I'm pulling the data out of the database and casting it as a string. I'm sure there is a simple fix for this but I've searched and haven't stumbled on the answer yet. Do I need to change an encoding option somewhere in my project. I'm using visual studio if that helps.
Edit: Winforms, I apologize for being vague.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
有一个简单的修复方法:下载支持日语字符的字体,并将其安装在您的电脑上,然后将该字体设置为用于显示文本的任何控件的字体。
请注意,将软件部署到其他计算机时,您必须确保也部署此字体。
There is a simple fix: download a font that supports Japanese characters, install it on your PC, and then set that font as the font for whatever control you're using to display the text.
Note that when deploying your software to other machines, you'll have to make sure that you also deploy this font.