C
C#2y ago
UNKNØWN

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

When I use Ø it gets outputted as O
11 Replies
MODiX
MODiX2y 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
Angius2y 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ØWNOP2y 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
Angius2y ago
No, it's the terminal's setting
UNKNØWN
UNKNØWNOP2y ago
I see, thank you for the help regardless
Angius
Angius2y 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ØWNOP2y ago
that did it, thank you 🙂
Angius
Angius2y ago
Nice
Buddy
Buddy2y ago
What are you making? catpog
UNKNØWN
UNKNØWNOP2y ago
Just a simple application that automatically sets custom settings within Windows like; 24 hour clock, small taskbar etc..
Accord
Accord2y 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.
Want results from more Discord servers?
Add your server