How to print utf8 text "Klöße" out to console ?

Just starting out? Need help? Post your questions and find answers here.
User avatar
Octopus
User
User
Posts: 55
Joined: Sat Jun 13, 2009 6:42 am
Location: Munich (Germany)
Contact:

How to print utf8 text "Klöße" out to console ?

Post by Octopus »

How to do this in a way, which will be working on all supported operating systems?
User avatar
luis
Addict
Addict
Posts: 3895
Joined: Wed Aug 31, 2005 11:09 pm
Location: Italy

Re: How to print utf8 text "Klöße" out to console ?

Post by luis »

Woks on Windows, does not work elsewhere ?

Code: Select all

CompilerIf (#PB_Compiler_Unicode = 1)
 OpenConsole()
 Print("Klöße")
 Input()
 CloseConsole()
CompilerElse 
 CompilerError "Enable Unicode"
CompilerEndIf
"Have you tried turning it off and on again ?"
User avatar
Octopus
User
User
Posts: 55
Joined: Sat Jun 13, 2009 6:42 am
Location: Munich (Germany)
Contact:

Re: How to print utf8 text "Klöße" out to console ?

Post by Octopus »

Thanks for this fillip!
User avatar
Shield
Addict
Addict
Posts: 1021
Joined: Fri Jan 21, 2011 8:25 am
Location: 'stralia!
Contact:

Re: How to print utf8 text "Klöße" out to console ?

Post by Shield »

If you don't want to use Unicode, you can use this for Windows:

Code: Select all

OpenConsole()
text$ = "Klöße"
CharToOem_(@text$, @text$)
Print(text$)
Input()
Image
Blog: Why Does It Suck? (http://whydoesitsuck.com/)
"You can disagree with me as much as you want, but during this talk, by definition, anybody who disagrees is stupid and ugly."
- Linus Torvalds
Post Reply