I have tried searching for a solution for this through this site and many others. I couldn't find an answer for it.
So, my problem would be to print special Scandinavian vowels such as Ä, Ö or Å in my console. Is it possible in c++ or not doable?
I tried searching ASCII codes through, but only found some other special characters.
Also, im just a very beginner in c++.
Thank you for your answers! :)
EDIT: For other very beginner programmers who haven't developed their skills much yet: I also found out a more beginner friendly (yet very time consuming and frustrating way) to print Scandinavian vowels in ASCII.
A snippet from code:
int main()
{
cout << "Kirjoitan t" << char(132) << "ss" << char(132)<< " huvikseni " <<;
cout << "Skandinaavisilla kirjaimilla p" << char(132) << "tk" << char(132) << "n." << endl;
return 0;
}
Which would obviously print out: "Kirjoitan tässä huvikseni Skandinaavisilla kirjaimilla pätkän." = "Im writing with Scandic alphabet just for fun."
It will just make your typing really messy and confusing.. Trying to learn the proper way to do it as i speak :)
Try including clocale
and calling
setlocale(LC_ALL, "utf-8");
or
setlocale(LC_ALL, "fi-FI");
early in your program (depending on what character set you are saving your .cpp files as). Depending on which compiler and platform you use, the language codes might be different; maybe you need just the language code "fi"
.
For other Scandinavian users, "nb-NO"
(Norweigan Bokmål), "nn-NO"
(Norwegian Nynorsk), "sv-SE"
(Swedish), "sv-FI"
(Swedish in Finland), or "da-DK"
(Danish) should do the trick.
Also, read Joel Spolsky's excellent article about character sets and encodings.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With