View Single Post
Old 03-09-2013, 05:07 PM   #12
Japo
Autonomous human
 
Japo's Avatar


 
Join Date: Mar 2006
Location: ,
Posts: 4,613
Default

Short answer: there's no way to print "ø" with the standard library. You're barking at the wrong door. Either you want a simple console C program, or you want to print strange characters. You can of course switch to a graphic mode (again not in the standard library) and use some font library. My advice is that you continue your C learning with interesting programs that are practical to write in C, not these pointless bells and whistles, you won't learn anything useful, let alone nowadays. Use "oe" instead etc.

Forget about "°", it's completely unrelated. Windows extended the number of characters that you can create with the numpad in that way, but that doesn't mean that the ASCII character "x" has any relationship with the character "0x". You just get sixteen times as many possible codes or characters.

Portable C (the standard library) supports ASCII characters (0-255) only--and be careful with the extended set (from 128 to the final end 255--see below why).

Nowadays there are simpler ways to get international characters as well as fancy windows and whatnot. Nobody uses the console, and when they do, they don't ask it to display funny stuff.

Back in the day MS-DOS came up with a way to print international characters on the console: the commands "MODE con codepage prepare" and "... select". Since there are many more than it's not possible to get all international characters. IIRC these commands replace the standard extended set (128-255) with country-specific characters (you select the country when you call the command, you can't have all characters at once). On the other hand, this would break the display of programs that rely on the standard extended ASCII set. Moreover, the MODE command is specific to MS-DOS; for example it doesn't come with DOSBox.
__________________
Life starts every day anew. Prospects not so good...
Japo is offline                         Send a private message to Japo
Reply With Quote