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