I am using the seed method to populate the database. Some of the objects have properties in cyrillic. Example:
context.Wines.AddOrUpdate(new Wine()
{
Id = 1,
Name = "Шардоне",
etc........................................
The objects are properly created in the database, however when I check the database in MS SQL management studio instead of the wine's name being "Шардоне", it is displayed as "Øàðäîíå".
Strangely, when I create the wine in my Startup class like this:
var db = new WineSystemDbContext();
var ShardoneWine = new Wine { Name = "Шардоне};
db.Wines.Add(ShardoneWine);
everything is displayed properly in cyrillic in the database.
Do you have an idea what may cause this?
You can specify the charset of your connectin in connection string. Just add this part to your connection:
charset=UTF8;
If no results you can try to change char-set of Configuration.cs file. There are two ways to do that.
You can also have problems if you are using ntext column type.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With