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 InitLanguageSel ector()
{
foreach (DirectoryInfo dir in this.countryBan nerDirs)
{
string cultureString = dir.Name;
CultureInfo culture = new CultureInfo(cul tureString);
this.changeBann erLanguage.Item s.Add(
new ListItem(this.F ormatCountryNam e(culture.Nativ eName),
culture.ToStrin g()));
}
this.changeBann erLanguage.Sele ctedIndexChange d += new
EventHandler(ch angeBannerLangu age_SelectedInd exChanged);
}
------------------------------------------------------------------------------------------------------
The code listing for the method FormatCountryNa me() is as follows:
------------------------------------------------------------------------------------------------------
private string FormatCountryNa me(string culture)
{
string country = string.Empty;
try
{
int pos = culture.IndexOf (" ");
country = culture.Substri ng(0, pos);
char first = country[0];
first = char.ToUpper(fi rst);
country = first + country.Substri ng(1);
}
catch (Exception ex)
{
Base.GetEventLo gger().LogEvent (1, "9999",
"Banners::Forma tCountryName", ex);
}
return country;
}
------------------------------------------------------------------------------------------------------
Any assistance will be gratefully received.
Cheers!
--
Regards
Chris Marsh