1

I have strings in my MsSql database with nvarchar column type. My seed method sample is this:

protected override void Seed(Sro.Models.ApplicationDbContext db)
    {
        Konu iyimi = new Konu { isim ="ıyımıdır", lastAktifTime = DateTime.Now, konuUrl = "iyimi", };
        db.Konu.AddOrUpdate(iyimi);
    }

when I execute the seed method some characters "ç, ö" are okay but "ı" character saving as "ý" in database, for example "ıyımıdır" appears "ýyýmýdýr". I tried differen sql servers but the result is same. By the way there's no problem with website queries. When I try to add new row when debugging it is okay. It doesn't make any sense to me. Thanks for any help.

Okan Aslankan
  • 3,016
  • 2
  • 21
  • 26

2 Answers2

1

Add "Charset=utf8" to entity connection string.

Entity Framework C# Insert Data russian encoding problems

Community
  • 1
  • 1
umut özkan
  • 132
  • 1
  • 8
0

Try add 'N' before string eg: UPDATE TableName SET Name = N'śćżas' WHERE Id = 0

Szynkie
  • 59
  • 3
  • This does not provide an answer to the question. Once you have sufficient [reputation](https://stackoverflow.com/help/whats-reputation) you will be able to [comment on any post](https://stackoverflow.com/help/privileges/comment); instead, [provide answers that don't require clarification from the asker](https://meta.stackexchange.com/questions/214173/why-do-i-need-50-reputation-to-comment-what-can-i-do-instead). - [From Review](/review/late-answers/30801185) – Serge P Jan 15 '22 at 05:54