1

I have exported my data to text File. It was open in file as utf-8 encoding. Then I've changed some text and tried to import it back to the database but now there are no Greek letters.

Coding is gone :(

How should I encode text file with inserts so that I don't loose coding after insert to database ?

thanks for any help

APC
  • 141,155
  • 19
  • 165
  • 275
gruber
  • 26,743
  • 31
  • 120
  • 211
  • 1
    Can you show us the SQL code and tables please? – gbn Sep 10 '11 at 17:06
  • Might not be an issue but keep in mind that SQL Server will always store XML using utf-8 encoding. So if your application is not saving the file as utf-8 after edits you make it can result in characters being interpreted incorrectly as SQL Server attempts to convert it back into utf-8. – Yuck Sep 10 '11 at 17:12
  • file is converted to utf-8, still doesnt work – gruber Sep 10 '11 at 17:20
  • @Yuck: The UTF is decided by the string and the encoding in the data. Internally it is always UTF-16 http://stackoverflow.com/questions/6857760/saving-xml-contents-with-iso-8859-1-encoding-using-entity-framework-into-sql-serv/6857882#6857882 and http://stackoverflow.com/questions/6888984/what-is-the-range-or-ms-sql-xml-argument/6889266#6889266 – gbn Sep 10 '11 at 17:23
  • How can I convert my utf-8 file to utf-16 so that I can easily insert it to database ? I ve got more thank 2 k insert commands and as I cand understand I just need to convert that file to utf-16 – gruber Sep 10 '11 at 17:32
  • 1
    @gruber: you don't have to convert it. What you have done is INSERTed it as a varchar literal most likely before it became xml. However, you haven't given us any sample code to verify this. And read my answer here: http://stackoverflow.com/questions/6857760/saving-xml-contents-with-iso-8859-1-encoding-using-entity-framework-into-sql-serv/6857882#6857882 – gbn Sep 10 '11 at 17:37

0 Answers0