views:

30

answers:

2

I have gone through my DB and code so far, I have hit a problem. For a particular enrty in my DB I pick up descriptions and tags (both are strings)for japanese language. Now, in a ASP.NET page,the description is shown fine but the tags which are japanese as well, are replaced with ? marks, what am I doing wrong here? The same page displays description fine but within a <div>, tags are replaced by ? marks. The code is as follows

string[] tags = (Html.Encode(Item.Tags)).Split(new Char[] {',','.'});

in a loop over tags i have

<% Html.Encode(tags)%> // This is not fine!

While for description I have

<% Html.Encode(Item.Description)%> // This is fine!
A: 

Are you encoding them twice? Html.Encode(Item.Tags) and then Html.Encode(tags)

CyberDude
Ok, i removed the second Html.encode (tags). Still not working
Wajih
Is the description and tags stored the same way in the database (same data type)?
CyberDude
Yup, I just checked again after reading your question. They appear fine as Japanese text.
Wajih
A: 

It turned out to be problem in the stored procedure. the variable storing the strings and returning them to ASP.NET had to be a nvarchar and rather was a varchar. Fixed my problem in ASP.NET eventually.

Wajih