Perhaps try to use oemtochar or chartooem, but input also have to work correctly. I don't want to offer my program so much, in fact it don't satisfy me and I want to change it, but don't find time for that. But at least it supports german characters and keyboard. If this code happens to be somewhat useful for you, I would be thankful if you would say whether it supports Norwegian characters or then what characters it don't support. http://sourceforge.net/projects/tkorrovi
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Thank you, indeed! Yes, I used chartooem and oemtochar functions, it is not so complicated, you may use the same string as input string and output string and then pass it to print function. Or you may write your own print function what inherits printf or such. Characters have to be converted because console comes from dos and ascii character set is used there but ansi character set is used in windows. Only the most common characters are the same in these character sets and so it's fine for english, but without conversion it writes special characters of other languages as garbage. There is another problem concerning input. It's easy to allow only the characters ' ' to 'z' but special characters are in very different places in the character set, so without that restriction you have to take care that these special characters what you don't use, for example tab, shall not be processed or printed as characters.
tkorrovi
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi,
Quick question:
I was wondering if anyone knows how I can get my program to display our local Norwegian special characters in a console app?
They are not printed correctly, and the isalpha function will tell me they're not alphabetic.
I do get the correct characters if I just start a regular dos-prompt (W98) and type.
-yvind (whose name starts with one of those characters...)
Perhaps try to use oemtochar or chartooem, but input also have to work correctly. I don't want to offer my program so much, in fact it don't satisfy me and I want to change it, but don't find time for that. But at least it supports german characters and keyboard. If this code happens to be somewhat useful for you, I would be thankful if you would say whether it supports Norwegian characters or then what characters it don't support.
http://sourceforge.net/projects/tkorrovi
Thanks.
I tested your program, and it does support the Norwegian special characters just fine.
I haven't had time to look at your source, but I tried CharToOem, and used printf to output the result, and that worked.
I don't like that soulution very much, though. I'll have to explicitly translate every string I want to print to the console...
How did you solve this? Did you use the CharToOem and OemToChar functions?
-yvind
Thank you, indeed! Yes, I used chartooem and oemtochar functions, it is not so complicated, you may use the same string as input string and output string and then pass it to print function. Or you may write your own print function what inherits printf or such. Characters have to be converted because console comes from dos and ascii character set is used there but ansi character set is used in windows. Only the most common characters are the same in these character sets and so it's fine for english, but without conversion it writes special characters of other languages as garbage. There is another problem concerning input. It's easy to allow only the characters ' ' to 'z' but special characters are in very different places in the character set, so without that restriction you have to take care that these special characters what you don't use, for example tab, shall not be processed or printed as characters.
tkorrovi