0

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?

G42
  • 9,791
  • 2
  • 19
  • 34
Andreea S
  • 1
  • 2

3 Answers3

1

Try this

Console.OutputEncoding = Encoding.UTF8;
Kemal Güler
  • 608
  • 1
  • 6
  • 21
1

Try using this before sending output:

Console.OutputEncoding = System.Text.Encoding.UTF8;

Checkout this Reference

Tahsin Gül
  • 108
  • 8
1

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();
    }