Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Chinese Characters in Page

0 views
Skip to first unread message

Chris Marsh

unread,
May 1, 2007, 6:59:41 AM5/1/07
to
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;
}

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

Any assistance will be gratefully received.

Cheers!

--

Regards

Chris Marsh


Chris Marsh

unread,
May 1, 2007, 7:10:45 AM5/1/07
to
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.

Walter Wang [MSFT]

unread,
May 2, 2007, 1:31:50 AM5/2/07
to
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 (waw...@online.microsoft.com, 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.

Chris Marsh

unread,
May 2, 2007, 10:55:29 AM5/2/07
to
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


0 new messages