Chinese Characters in Page

C

Chris Marsh

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_SelectedIndexChanged);
}

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

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;
}
 
C

Chris Marsh

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

Walter Wang [MSFT]

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 ([email protected], remove 'online.')
Microsoft Online Community Support

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.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/subscriptions/support/default.aspx.
==================================================

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

Chris Marsh

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!

[..]
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,071
Latest member
MetabolicSolutionsKeto

Latest Threads

Top