Solved

Chinese Characters not working in Menu

Posted on 2013-01-10
13
271 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
Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

 
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

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Preface This is the third article about the EE Collaborative Login Project. A Better Website Login System (http://www.experts-exchange.com/A_2902.html) introduces the Login System and shows how to implement a login page. The EE Collaborative Logi…
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.
This video teaches users how to migrate an existing Wordpress website to a new domain.
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.

705 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

12 Experts available now in Live!

Get 1:1 Help Now