Solved

Chinese Characters not working in Menu

Posted on 2013-01-10
13
274 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Technology Partners: 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 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

Creating Instructional Tutorials  

For Any Use & On Any Platform

Contextual Guidance at the moment of need helps your employees/users adopt software o& achieve even the most complex tasks instantly. Boost knowledge retention, software adoption & employee engagement with easy solution.

Question has a verified solution.

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

Suggested Solutions

Color can increase conversions, create feelings of warmth or even incite people to get behind a cause. If you want your website to really impact site visitors, then it is vital to consider the impact color has on them.
In threads here at EE, each comment has a unique Identifier (ID). It is easy to get the full path for an ID via the right-click context menu. However, we often want to post a short link within a thread rather than the full link. This article shows a…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
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)

730 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