实体框架西里尔文显示为问号 [英] Entity Framework Cyrillic displayed as question marks

查看:117
本文介绍了实体框架西里尔文显示为问号的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在写一个应用程序,我正在使用Entity Framework和MSSQL。数据库中我有一些西里尔文数据(保加利亚语,如果重要)。问题是当我尝试从程序中读取它得到问号(?????????),但是当我尝试从SQL管理工作室的一切都显示出来。排序规则设置为Cyrillic_General_CI_AS,我正在使用nvarchar为我存储西里尔字符的列。我需要你的帮助。我如何解决这个问题?

解决方案

我找到了解决方案。事实证明,从数据库出来的数据是完美的。问题在于显示。我正在使用控制台项目进行测试,显然不喜欢西里尔字体。更改控制台的字体修复了我的问题。


I am writing an application and I am using Entity Framework and MSSQL. I have some cyrillic data(Bulgarian, if that matters) in the database. Problem is when I try to read it from the program I get question marks(?????????) but when I try from SQL Management studio everything shows up fine. Collation is set to Cyrillic_General_CI_AS and I am using nvarchar for the columns I store cyrillic characters in. I need your help. How can I fix this?

解决方案

I found the solution. It turns out that the data that comes out of the database is perfectly fine. The problem was in the displaying. I was using a console project for testing and it apparently didn't like the cyrillic font. Changing the font of the console fixed my problem.

这篇关于实体框架西里尔文显示为问号的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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