1

In my sql database the following text is stored as Эштон: США и ЕС готовят помощь Украине

This data is retrieved into a model and rendered using Razor Engine using the @Raw function. The Html is fine as this is stored in the database.

However, the content comes back as '???????????????????'. In the Html template for the email i mark the meta tag as

 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

What is wrong?

Jon Hanna
  • 110,372
  • 10
  • 146
  • 251
ninjaplayer
  • 65
  • 4
  • 13
  • 4
    Those are not [Arabic characters](http://en.wikipedia.org/wiki/Arabic_script), but [Cyrillic characters](http://en.wikipedia.org/wiki/Cyrillic_script). – O. R. Mapper Feb 03 '14 at 09:14
  • What type of the field in your database? if it is varchahr(..) change it to nvarchar(..) then store the and get back to see what it returns. – Iqbal Feb 03 '14 at 09:17
  • What is encoding of the database, what is encoding of emails? – el vis Feb 03 '14 at 09:17
  • The field is NVarChar. The email is sent as HTML. – ninjaplayer Feb 03 '14 at 09:18
  • Perhaps this link can help you http://stackoverflow.com/questions/5055659/c-sharp-unicode-string-output ITs a diskussion about the encode/decode part but also practic problem related to work with I.e. Cyrillic character set. – Independent Mar 01 '14 at 08:12

2 Answers2

0

Your likely using a character encoding which does not include the characters you want to display so you just need to specify an encoding that does include those characters so when its displayed, the program displaying it knows what it is.

You should sent the character encoding to Cyrillic(KOI8-R).

davidcondrey
  • 34,416
  • 17
  • 114
  • 136
0

You should check for User email encoding set up too. And put it there as UTF-8.

  • Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Jul 08 '22 at 00:23