Solved

Chinese Characters not working in Menu

Posted on 2013-01-10
13
273 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
Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

 

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

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
best platform for custom social media website and mobile app 2 94
Form Processing in PHP 11 41
Where can I find... 1 31
CSS: Making responsive table look nicer 7 26
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.
FAQ pages provide a simple way for you to supply and for customers to find answers to the most common questions about your company. Here are six reasons why your company website should have a FAQ page
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…

770 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