C
C#3y ago
UNKNØWN

❔ How do I write Ø in a .NET framework Console application?

When I use Ø it gets outputted as O
11 Replies
MODiX
MODiX3y ago
Angius#1586
REPL Result: Success
Console.Write("Ø");
Console.Write("Ø");
Console Output
Ø
Ø
Compile: 487.105ms | Execution: 64.813ms | React with ❌ to remove this embed.
Angius
Angius3y ago
Seeing how it works in the repl, it's probably the fault of the terminal you're using Either the font has this character missing, or some terminal setting is responsible How to fix it with code, then? Chances are you can't
UNKNØWN
UNKNØWNOP3y ago
I don't suppose you can make the application use a custom font and then embed it so the user doesn't need to install it?
Angius
Angius3y ago
No, it's the terminal's setting
UNKNØWN
UNKNØWNOP3y ago
I see, thank you for the help regardless
Angius
Angius3y ago
You could try using
Console.OutputEncoding = System.Text.Encoding.UTF8;
Console.OutputEncoding = System.Text.Encoding.UTF8;
This should force the encoding to be UTF-8 Whether the terminal supports it or not, is still another matter, though
UNKNØWN
UNKNØWNOP3y ago
that did it, thank you 🙂
Angius
Angius3y ago
Nice
Buddy
Buddy3y ago
What are you making? catpog
UNKNØWN
UNKNØWNOP3y ago
Just a simple application that automatically sets custom settings within Windows like; 24 hour clock, small taskbar etc..
Accord
Accord3y ago
Was this issue resolved? If so, run /close - otherwise I will mark this as stale and this post will be archived until there is new activity.

Did you find this page helpful?