Solved

Chinese Characters not working in Menu

Posted on 2013-01-10
13
272 Views
Last Modified: 2013-01-20
I am having a problem displaying chinese characters in the menu of my website. I had a simiar issue prior to this that was resolved by changing the encoding to utf=8. Afterward the chinese characters display fine. I just tried to change a menu item to chinese and am getting the weird gobbly gook again. My site is coded in C# and is aspx. Any ideas?
0
Comment
Question by:scotgwhiz
  • 7
  • 6
13 Comments
 
LVL 51

Expert Comment

by:ahoffmann
ID: 38766097
you need to send the HTTP header like

Content-Type: text/html; charset=utf-8

also ensure that your HTML content does not contain a meta tag telling a different charset
0
 

Author Comment

by:scotgwhiz
ID: 38767451
Here is what is currently at the top of the master page:

<%@ Master Language="C#" AutoEventWireup="true" CodeFile="site.master.cs" Inherits="myPageBasePage" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head runat="server">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Study Abroad - Colorado State University</title>
<meta name="description" content="generic wireframe"/>
<meta name="keywords" content="colorado,state,university"/>
<meta name="MSSmartTagsPreventParsing" content="TRUE" />
<meta content="off" name="autosize" />
<meta content="no" http-equiv="imagetoolbar" />
<meta http-equiv="Content-Style-Type" content="text/css" />
<%=baseHref%>
0
 
LVL 51

Expert Comment

by:ahoffmann
ID: 38767492
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

this look ook, but only if the server sends it with

Content-Type: text/html; charset=utf-8

if you can't check your server configuration, user a browser plugin (like LiveHTTPheader, Firebug in Firefox or Fiddler in IE) to see what the server actually sends
0
 

Author Comment

by:scotgwhiz
ID: 38767646
I installed fiddler and placed the crosshair icon on the page and did a refresh. In the text view it returned the following:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><title>edited out
      </title><meta name="description" content="generic wireframe" /><meta name="keywords" content="edited out" /><meta name="MSSmartTagsPreventParsing" content="TRUE" /><meta content="off" name="autosize" /><meta content="no" http-equiv="imagetoolbar" /><meta http-equiv="Content-Style-Type" content="text/css" />

<link rel="stylesheet" href="/_support/css/vs.css" type="text/css" media="screen, projection" />

etc...

It just seems strange that the Chinese characters are working fine on the rest of the site but not the menu items....
0
 
LVL 51

Expert Comment

by:ahoffmann
ID: 38769012
> ...  but not the menu items....

are these items plain HTML, then you most likely have a UTF-8 problem with your file
if the menu is build using a script (i.e. JavaScript), then it migh also be the script which is
not proper designed
0
 

Author Comment

by:scotgwhiz
ID: 38769137
Here's the coding for the navigation bar:

<div id="navbar" class="hNav">
      
        <ul>
              <li><a href="<%= ResolveUrl("../index.aspx") %>">¿¿</a></li>
            <li><a href="<%= ResolveUrl("../students.aspx") %>">Students</a></li>
            <li><a href="<%= ResolveUrl("../partners.aspx") %>">Partners</a></li>
                       <li><a href="<%= ResolveUrl("../about.aspx") %>" id="redirect">About </a></li>
            <li><a href="<%= ResolveUrl("../staff.aspx") %>" id="redirect">Staff</a></li>
                    </ul>
0
DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

 
LVL 51

Expert Comment

by:ahoffmann
ID: 38769566
sounds more like an editor problem than a web server problem
most likely yor file is not stored in the proper format (or you keeyd in the characters in the wrong format)
can you please check on the filesystem if the file contains the proper characters
0
 

Author Comment

by:scotgwhiz
ID: 38775501
I tried using the original font which I used and which worked in the pages of the site. The characters look correct in Dreamweaver and on the remote server version of the page. It just renders weird online...
0
 
LVL 51

Assisted Solution

by:ahoffmann
ahoffmann earned 500 total points
ID: 38777970
the question is *NOT* what your editor shows you, but what it will write into the file
you have to check with native tools what exactly is written to your file
0
 

Accepted Solution

by:
scotgwhiz earned 0 total points
ID: 38779118
Well, I finally found something that worked....I added file encoding=utf-8 to the globalization setting in the web config file. <globalization requestEncoding="utf-8" responseEncoding="utf-8" fileEncoding="utf-8"  />. The fileEncoding was the missing key, I had already changed the other two. I appreciate your help and award for effort. Thanks..
0
 
LVL 51

Expert Comment

by:ahoffmann
ID: 38785044
perfect that you finally identified the configuration option,
I assume that my very first comment #38766097 is the one pointing to that
0
 

Author Comment

by:scotgwhiz
ID: 38785122
It definitely helped but when I  first looked I did not recognize that the fileEncoding setting was missing. It had the other two set to UTF-8 but not the one that was needed. It was lacking all together...Thanks.
0
 

Author Closing Comment

by:scotgwhiz
ID: 38798076
Adding the fileEncoding="utf-8" to the globalization setting in the web config file of my asp.net web site resolved the issue with displaying chinese characters in the menu of the master.page.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Envision that you are chipping away at another e-business site with a team of pundit developers and designers. Everything seems, by all accounts, to be going easily.
Developer portfolios can be a bit of an enigma—how do you present yourself to employers without burying them in lines of code?  A modern portfolio is more than just work samples, it’s also a statement of how you work.
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
Any person in technology especially those working for big companies should at least know about the basics of web accessibility. Believe it or not there are even laws in place that require businesses to provide such means for the disabled and aging p…

920 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now