petko_stankoski
petko_stankoski

Reputation: 10713

Encoding issue: can't find the item in db although it exists

I have this entry in my db:

tést

What I get from the user is:

"tést"

and when I'm searching it in db I get null results, because it doesn't exist. How to convert é to é?

This is my code:

(from x in db.tblMyTable where x.name == "tést" select x)

I use entity framework.

Upvotes: 0

Views: 67

Answers (1)

Guffa
Guffa

Reputation: 700322

To convert that string, you would use the HtmlDecode method:

str = Server.HtmlDecode(str);

However, you should look into why the value comes HTML encoded when it really shouldn't.

Upvotes: 3

Related Questions