E
E-John
Guest
Dear All,
I have got all CultureInfo by following code, but some characters can not be display on RichTextBox component, but they can be display on Visual Studio 2017 output window,
for example, Amharic native name can not be display on RichTextBox but they can be display on Visual Studio 2017 output window, any suggestion?
Thanks and Best regards,
E-John
Code snippet are as follows,
class ListOfCultureInfo : IDisposable
{
CultureInfo[] cultures;
public CultureInfo[] GetListOfCulture()
{
//
// Get the list of supported cultures filtered by the
// CultureTypes.
//
cultures = CultureInfo.GetCultures(CultureTypes.AllCultures);
//
// Iterates array of CultureInfo and print the culture name
// (language code-country code) and culture name in English.
//
int i = 0;
foreach (CultureInfo culture in cultures)
{
Debug.WriteLine(String.Format("{0, -5} {1, -20}{2, -60}{3}",
i++, culture.Name, culture.EnglishName, culture.NativeName));
}
return cultures;
}
// Implement IDisposable.
public void Dispose()
{
if (cultures != null)
{
cultures = null;
GC.SuppressFinalize(this);
}
}
}
private void button3_Click(object sender, EventArgs e)
{
using (ListOfCultureInfo oListOfCulture = new ListOfCultureInfo())
{
CultureInfo[] cultures = oListOfCulture.GetListOfCulture();
int i = 0;
foreach (CultureInfo culture in cultures)
{
String cultureInfo = String.Format("{0, -5} {1, -20}{2, -60}{3}",
i++,
culture.Name,
culture.EnglishName,
culture.NativeName);
richTextBox1.AppendText(cultureInfo + "\r\n");
}
}
}
Continue reading...
I have got all CultureInfo by following code, but some characters can not be display on RichTextBox component, but they can be display on Visual Studio 2017 output window,
for example, Amharic native name can not be display on RichTextBox but they can be display on Visual Studio 2017 output window, any suggestion?
Thanks and Best regards,
E-John
Code snippet are as follows,
class ListOfCultureInfo : IDisposable
{
CultureInfo[] cultures;
public CultureInfo[] GetListOfCulture()
{
//
// Get the list of supported cultures filtered by the
// CultureTypes.
//
cultures = CultureInfo.GetCultures(CultureTypes.AllCultures);
//
// Iterates array of CultureInfo and print the culture name
// (language code-country code) and culture name in English.
//
int i = 0;
foreach (CultureInfo culture in cultures)
{
Debug.WriteLine(String.Format("{0, -5} {1, -20}{2, -60}{3}",
i++, culture.Name, culture.EnglishName, culture.NativeName));
}
return cultures;
}
// Implement IDisposable.
public void Dispose()
{
if (cultures != null)
{
cultures = null;
GC.SuppressFinalize(this);
}
}
}
private void button3_Click(object sender, EventArgs e)
{
using (ListOfCultureInfo oListOfCulture = new ListOfCultureInfo())
{
CultureInfo[] cultures = oListOfCulture.GetListOfCulture();
int i = 0;
foreach (CultureInfo culture in cultures)
{
String cultureInfo = String.Format("{0, -5} {1, -20}{2, -60}{3}",
i++,
culture.Name,
culture.EnglishName,
culture.NativeName);
richTextBox1.AppendText(cultureInfo + "\r\n");
}
}
}
Continue reading...