Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

Chinese Characters not working in Menu

Posted on 2013-01-10
13
Medium Priority
?
281 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
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

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
 
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 1500 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

Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

Question has a verified solution.

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

When the s#!t hits the fan, you don’t have time to look up who’s on call, draft emails, call collaborators, or send text messages. An instant chat window is definitely the way to go, especially one like HipChat. HipChat is a true business app. An…
How do you create a user-centered user experience on your website? And what are some things you should consider in the process?
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…
Suggested Courses

580 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