473,324 Members | 2,511 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,324 software developers and data experts.

Chinese Characters in Page

Greetings All

I have a number of subdirectories, which are named as per the culture that
they refer to; for example the Italian folder is named it-IT. I then
generate a DropDownList on my ASPX page from this folder list. All languages
are displayed correctly in the HTML rendered by the DropDownList, excpet
Chinese (zh-CN), which displays as little squares. I've tried using a meta
tag to specify UTF-8 as the encoding for the page, and I've saved the page
as Unicode (UTF-8 with signature) - Codepage 65001, but to no avail. Can
anyone assist me in displaying the Chinese characters in this page?

There follows the code listing for my initialisation method for the
DropDownList:
------------------------------------------------------------------------------------------------------

private void InitLanguageSelector()
{
foreach (DirectoryInfo dir in this.countryBannerDirs)
{
string cultureString = dir.Name;
CultureInfo culture = new CultureInfo(cultureString);
this.changeBannerLanguage.Items.Add(
new ListItem(this.FormatCountryName(culture.NativeName ),
culture.ToString()));
}
this.changeBannerLanguage.SelectedIndexChanged += new
EventHandler(changeBannerLanguage_SelectedIndexCha nged);
}

------------------------------------------------------------------------------------------------------

The code listing for the method FormatCountryName() is as follows:

------------------------------------------------------------------------------------------------------

private string FormatCountryName(string culture)
{
string country = string.Empty;
try
{
int pos = culture.IndexOf(" ");
country = culture.Substring(0, pos);
char first = country[0];
first = char.ToUpper(first);
country = first + country.Substring(1);
}
catch (Exception ex)
{
Base.GetEventLogger().LogEvent(1, "9999",
"Banners::FormatCountryName", ex);
}
return country;
}

------------------------------------------------------------------------------------------------------

Any assistance will be gratefully received.

Cheers!

--

Regards

Chris Marsh
May 1 '07 #1
3 1293
All

Sorry, I forgot to explicitly mention that the aim is to produce a
DropDownList where the text for each ListItem object is a language name in
that language. Therefore, the folder "en-GB" would have the ListItem with
the text "English", &c.
I have a number of subdirectories, which are named as per the culture that
they refer to; for example the Italian folder is named it-IT. I then
generate a DropDownList on my ASPX page from this folder list. All
languages are displayed correctly in the HTML rendered by the
DropDownList, excpet Chinese (zh-CN), which displays as little squares.
I've tried using a meta tag to specify UTF-8 as the encoding for the page,
and I've saved the page as Unicode (UTF-8 with signature) - Codepage
65001, but to no avail. Can anyone assist me in displaying the Chinese
characters in this page?

There follows the code listing for my initialisation method for the
DropDownList:
------------------------------------------------------------------------------------------------------

private void InitLanguageSelector()
{
foreach (DirectoryInfo dir in this.countryBannerDirs)
{
string cultureString = dir.Name;
CultureInfo culture = new CultureInfo(cultureString);
this.changeBannerLanguage.Items.Add(
new ListItem(this.FormatCountryName(culture.NativeName ),
culture.ToString()));
}
this.changeBannerLanguage.SelectedIndexChanged += new
EventHandler(changeBannerLanguage_SelectedIndexCha nged);
}

------------------------------------------------------------------------------------------------------

The code listing for the method FormatCountryName() is as follows:

------------------------------------------------------------------------------------------------------

private string FormatCountryName(string culture)
{
string country = string.Empty;
try
{
int pos = culture.IndexOf(" ");
country = culture.Substring(0, pos);
char first = country[0];
first = char.ToUpper(first);
country = first + country.Substring(1);
}
catch (Exception ex)
{
Base.GetEventLogger().LogEvent(1, "9999",
"Banners::FormatCountryName", ex);
}
return country;
}

------------------------------------------------------------------------------------------------------

Any assistance will be gratefully received.

Cheers!

--

Regards

Chris Marsh


May 1 '07 #2
Hi Chris,

I believe you need to install required fonts to display Chinese characters,
if you're on Windows XP, please use following steps to install them:

1) Control Panel
2) Regional and Language Options
3) Tab "Languages", check "Install files for East Asian languages"
4) Select OK
Please feel free to let me know if this works or not for you. Thanks.
Sincerely,
Walter Wang (wa****@online.microsoft.com, remove 'online.')
Microsoft Online Community Support

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications. If you are using Outlook Express, please make sure you clear the
check box "Tools/Options/Read: Get 300 headers at a time" to see your reply
promptly.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscripti...t/default.aspx.
==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.

May 2 '07 #3
Walter
I believe you need to install required fonts to display Chinese
characters,
if you're on Windows XP, please use following steps to install them:
This was the solution - many thanks for your assistance, Walter!

[..]

--
Regards

Chris Marsh
May 2 '07 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Jeff | last post by:
Having a problem displaying both german and chinese characters from a UTF-8 database on the same *.jsp page. Can make Chinese characters appear correctly by including the following lines: <%@...
2
by: Ian | last post by:
Hi, I've got an english site designed that I need to translate into Chinese. I've got the Chinese wording to work with but I can't figure out how to get it into my code. I thought I could...
2
by: Antonio Ooi | last post by:
Hi, Probably due to my 'Language for non-Unicode Setting' in Regional Settings, my ASP page keeps outputing the date format as Chinese Simplified characters when issuing say, <%=Now()%>. In...
6
by: Zhang Weiwu | last post by:
Hello. I am working with a php software project, in it (www.egroupware.org) Chinese simplified locate is "zh" while Traditional Chinese "tw". I wish to send correct language attribute in http...
1
by: Antonio | last post by:
With the following page aspx I try to translate one my page from English to Chinese, using UTF8, the result Is that the Chinese characters do not come read correctly, if instead I insert directly...
8
by: pabv | last post by:
Hello all, I am having a few issues with encoding to chinese characters and perhaps someone might be able to assist. At the moment I am only able to see chinese characters when displayed as...
4
by: K | last post by:
I've an XML file in UTF-8. It contains some chinese characters ( both simplified chinese and traditional chinese). In loading the XML file with MSXML parser, I used the below code to retrieve...
1
by: wtistang | last post by:
I need some suggestions regarding a problem I am facing. I have a web page (asp.net and C#) which containing Chinese characters. In my web.config file I have: <globalization...
7
by: c.verma | last post by:
I have a web application. There is a page which has a datagrid on it.The datagrid displays the data that comes from SAP. SAP sends the chinese characters to this grid. Before I display CHinese...
15
by: Lorenzo Stella | last post by:
Hi all, I haven't experienced functional programming very much, but now I'm trying to learn Haskell and I've learned that: 1) in functional programming LISTS are fundmental; 2) any "cycle" in FP...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.