Click here to Skip to main content
15,914,165 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

I have been trying so hard to get Chinese characters displayed correctly in Content Pages that using a Master Page but just can't get it resolved.Please help me out.

Thanks & Regards,
Shivaraj
Posted

To set Chinese language for perticuler page you can use this code

VB
System.Web.UI.HtmlControls.HtmlMeta _keyWords = new HtmlMeta(); 

Response.ContentEncoding = Encoding.GetEncoding("GB_2312-80")
                    _keyWords.Content = "text/html; charset=GB_2312-80"

   languageMetaTag.Visible = True
            languageMetaTag.Controls.Add(_keyWords)


And in design:

XML
<%@ page language="vb" autoeventwireup="false" validaterequest="false" codebehind="xyz.aspx.vb" inherits="ABC.WebForm1" %>
<asp:placeholder id="languageMetaTag" runat="server" visible="false"/>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">




What this code will do set content encoding and add meta tag in your page.
 
Share this answer
 
v3
Comments
Shivaraj Poojary 20-Dec-11 4:47am    
Hi..I want to know from where _keyWords is coming...and am not able to take the id of placeholder in .cs page...please detail me above code..thanks a lot
Anuj Banka 20-Dec-11 5:18am    
i have updated my solution.And if you are doing correct you will get the id of place holder.Or else you can search how to add meta tag from code behind you will find it easily.
Shivaraj Poojary 20-Dec-11 5:40am    
Thanks a lot Anuj...
Hi,

you can try Unicode encoding for display purpose, please check this link UTF8

hope this will help you,

thanks
-amit.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900