Insert UTF8 data into a SQL Server 2008
问题 I have an issue with encoding. I want to put data from a UTF-8-encoded file into a SQL Server 2008 database. SQL Server only features UCS-2 encoding, so I decided to explicitly convert the retrieved data. // connect to page file _fsPage = new FileStream(mySettings.filePage, FileMode.Open, FileAccess.Read); _streamPage = new StreamReader(_fsPage, System.Text.Encoding.UTF8); Here's the conversion routine for the data: private string ConvertTitle(string title) { string utf8_String = Regex