Thread: International (scandinavian) characters?

  1. #1
    Unregistered
    Guest

    Question International (scandinavian) characters?

    Hi!

    I'm totally new to C++ and I'm using Bloodshed Dev-C++, running on Windows 2000.

    When typing a cout statement including the scandinavian characters å, ä or ö the output from the program is completely different than stated in the source code, other characters that is.

    This is my code:


    #include <iostream.h>
    #include <stdlib.h>

    int main()
    {
    char quit;
    while (quit != 'q')
    {
    // Börja skriva din main()-kod efter denna rad.


    // Skriv ingen main()-kod under denna rad.
    cout << "Tryck på 'q' och sedan enter för att avsluta.";
    cin >> quit;
    }

    return 0;
    }

    This becomes:

    Tryck põ 'q' och sedan enter f/r att avsluta.

    What shall I do make the cout statement come out correct when running the program? Shall I use #include together with some .h-file to get it to work?

    I would really appreciate if someone could help me with this.

    /Roger Li, Sweden

  2. #2
    Registered User
    Join Date
    Dec 2001
    Posts
    194
    Hey, here is a tutorial on using UNICODE. This tutorial was written by a citizen of Sweden. I dont know anything about unicode other then what i read in the tutorial, so if you have questions email the author of the tutorial.
    http://www.flipcode.com/tutorials/tut_strings01.shtml
    and here is the home page http://www.unicode.org/

  3. #3
    It's full of stars adrianxw's Avatar
    Join Date
    Aug 2001
    Posts
    4,829
    >>> the scandinavian characters å, ä or ö

    There are other Scandinavian characters you know!

    Seriously, the set of additional characters we use here are defined in the ASCII set, so it should not be necessary to use UNICODE, (although that is an option of course). I have no problem here using VC++. Is your machine set up with the correct language settings? Is your compiler correctly localised, (I don't use Bloodsehd so can't tell you how to check that), but possibly if you cast a char with an Å in it for example, to an int, you can check that it is storing the right values.
    Wave upon wave of demented avengers march cheerfully out of obscurity unto the dream.

  4. #4
    Unregistered
    Guest

    Thanks

    Thank you gentlemen for your help. Today I noticed the same problem when running some Java-code in the command window so the problem is probably not related to my C++ compiler or editor or anything else C++-ish. As you mentioned some language setting must be wrong on my computer. I'll check it out. Thanks again!

    /Roger Li

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. A development process
    By Noir in forum C Programming
    Replies: 37
    Last Post: 07-10-2011, 10:39 PM
  2. HELP!!!!emergency ~expert please help
    By unknowppl in forum C Programming
    Replies: 1
    Last Post: 08-19-2008, 07:35 AM
  3. Replies: 10
    Last Post: 07-10-2008, 03:45 PM
  4. How do you check how many characters a user has entered?
    By engstudent363 in forum C Programming
    Replies: 5
    Last Post: 04-08-2008, 06:05 AM
  5. help with text input
    By Alphawaves in forum C Programming
    Replies: 8
    Last Post: 04-08-2007, 04:54 PM