Hi All,
Good day!
How can I internationalize a smartdevice application. I want to display all data to datagrid in asian languages(Chinese, Vietnamese, etc) I create a resource file for each languages. My problem is, it was not able to display the correct string(还是用中文吧) instead it will display a garbage string o boxes. No problem in english it will display properly.
code:
private void Form1_Load(object sender, EventArgs e)
{
customersBindingSource = new BindingSource();
List<customers> custList = new List<customers>();
custList = Customers.GetAllCustomers();
customersBindingSource.DataSource = custList;
dataGrid1.DataSource = customersBindingSource;
dataGrid1.TableStyles[0].GridColumnStyles[0].HeaderText = ResWMSPDA.Code_ZH;
dataGrid1.TableStyles[0].GridColumnStyles[1].HeaderText = ResWMSPDA.Name_ZH;
dataGrid1.TableStyles[0].GridColumnStyles[2].HeaderText = ResWMSPDA.Address_ZH;
dataGrid1.Dock = DockStyle.Fill;
}
</customers></customers>
public class Customers
{
public string code { get; set; }
public string name { get; set; }
public string address { get; set; }
public Customers(string code, string name, string address)
{
this.code = code;
this.name = name;
this.address = address;
}
public static List<customers> GetAllCustomers()
{
List<customers> tempCustomers = new List<customers>();
Customers customer1 = new Customers("1","Customer 1","Address 1" );
Customers customer2 = new Customers("2", "Customer 2", "Address 2");
Customers customer3 = new Customers("3", "客户 3", "地址 3");
Customers customer4 = new Customers("4", "客户 4", "地址 4");
tempCustomers.Add(customer1);
tempCustomers.Add(customer2);
tempCustomers.Add(customer3);
tempCustomers.Add(customer4);
return tempCustomers;
}
}
</customers></customers></customers>
output:
All chinese charaters display garbage string or boxes.
Any help is highly appreciated.
Thanks you very much.