Click here to Skip to main content
15,881,687 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I start to make a project using c# language
and it's done
now i want to test it on another pc runnig windows 10
but it show's perisian letter az '?'
and it save the data to data base again with '?'
how to fix this?
please help me

What I have tried:

create table and data base in utf 8
Posted
Updated 10-Jul-17 4:21am
Comments
Joezer BH 10-Jul-17 9:27am    
Do you have the languase support on your Windows10?

1 solution

Make sure you use NVARCHAR() instead of VARCHAR() (I assume your are using SQL Server), this is necessary for storing Unicode characters.
Internally C# always uses Unicode, 2 bytes for every character, unless you specify otherwise with Encoding, see: Encoding Class (System.Text)[^]
Also see CultureInfo.CurrentCulture: CultureInfo.CurrentCulture Property (System.Globalization)[^]
 
Share this answer
 
Comments
Karthik_Mahalingam 12-Jul-17 23:47pm    
5

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900