Reputation: 1
I have a problem with these two special characters from romanian language: ț
and ș
.
Example:
String s = "ștrumf";
The result is ?trumf
when I write the string to console.
Does anyone know what may be the reason?
Upvotes: 0
Views: 371
Reputation: 46
You, should set Console.OutputEncoding as UTF8
static void Main(string[] args) { Console.OutputEncoding = System.Text.Encoding.UTF8; String s = "ștrumf"; Console.WriteLine(s); Console.ReadLine(); }
Upvotes: 1
Reputation: 118
Try using this before sending output:
Console.OutputEncoding = System.Text.Encoding.UTF8;
Checkout this Reference
Upvotes: 1