Get correct output from UTF-8 stored in VarChar using Entity Framework or Linq2SQL?
Posted
by jasonpenny
on Stack Overflow
See other posts from Stack Overflow
or by jasonpenny
Published on 2010-04-01T03:35:37Z
Indexed on
2010/04/01
3:43 UTC
Read the original article
Hit count: 374
Borland StarTeam seems to store its data as UTF-8 encoded data in VarChar fields. I have an ASP.NET MVC site that returns some custom HTML reports using the StarTeam database, and I would like to find a better solution for getting the correct data, for a rewrite with MVC2.
I tried a few things with Encoding
GetBytes and GetString, but I couldn't get it to work (we use mostly Delphi at work); then I figured out a T-SQL function to return a NVarChar from UTF-8 stored in a VarChar, and created new SQL views which return the data as NVarChar, but it's slow.
The actual problem appears like this: “descriptionâ€
instead of “description”
, in both SSMS and in a webpage when using Linq2SQL
Is there a way to get the proper data out of these fields using Entity Framework or Linq2SQL?
© Stack Overflow or respective owner