Thread: Characters like á õ ü in DOS

  1. #1
    Registered User
    Join Date
    Sep 2006
    Posts
    57

    Characters like á õ ü in DOS

    Is possible to somehow write those special characters in DOS? (Sorry but i forgot the english name of them).
    Because in portuguese we use it a lot.

  2. #2
    Devil's Advocate SlyMaelstrom's Avatar
    Join Date
    May 2004
    Location
    Out of scope
    Posts
    4,079
    Well... ü is the ascii character 129. The others I believe are Unicode, unless I'm not seeing them on the ascii chart. Most of the accented vowels and consonants that appear in French and Spanish appear to be there, but for some reason some common ones from other languages (like for instance a with an acute) aren't there. If you want to print a character by it's ascii value, just cast the integer value.
    Code:
    std::cout << (char)129;
    Oh, by the way... since 128 to 255 is extended, it may vary on different computers, so even with those a standard Unicode format is more acceptable, I think.
    Last edited by SlyMaelstrom; 09-28-2006 at 05:54 PM.
    Sent from my iPad®

  3. #3
    (?<!re)tired Mario F.'s Avatar
    Join Date
    May 2006
    Location
    Ireland
    Posts
    8,446
    The Extended ASCII set has all characters needed for the Portuguese language.
    Just make sure your editor allows for ISO 8859-1 or ANSI 1252 Latin 1.

    It is possible that an expression such as std::cout << "can&#231;&#227;o"; might fail at the console by displaying the wrong characters. If that is the case, then you must also have the console set for the correct codepage.
    Originally Posted by brewbuck:
    Reimplementing a large system in another language to get a 25% performance boost is nonsense. It would be cheaper to just get a computer which is 25% faster.

  4. #4
    Registered User
    Join Date
    Sep 2006
    Posts
    57
    Ok, i'll search how to "correct" my console in google

  5. #5
    Registered User
    Join Date
    May 2003
    Posts
    1,619
    Quote Originally Posted by Mario F.
    It is possible that an expression such as std::cout << "canção"; might fail at the console by displaying the wrong characters. If that is the case, then you must also have the console set for the correct codepage.
    In general I believe you should not use non-ANSI characters in string literals. You'd store the strings in a data file and read them from there.
    You ever try a pink golf ball, Wally? Why, the wind shear on a pink ball alone can take the head clean off a 90 pound midget at 300 yards.

  6. #6
    Devil's Advocate SlyMaelstrom's Avatar
    Join Date
    May 2004
    Location
    Out of scope
    Posts
    4,079
    Though, keep in mind, you'll likely have to "fix" the consoles of any other computer that runs it too... that can be a pain on distribution. To be honest, I have no idea how to use a specific Unicode set in C++ as I'm from the US and our alphabet is adequately supported by ASCII.

    You could always google it.
    Sent from my iPad®

  7. #7
    Registered User
    Join Date
    Sep 2006
    Posts
    57
    Google tells me how to make the console show acents characters, but i have no idea of how to config my msvs to use "ISO 8859-1 or ANSI 1252 Latin 1".

    (Anyway the app is just for my pc )

  8. #8
    Registered User
    Join Date
    May 2003
    Posts
    1,619
    Quote Originally Posted by SlyMaelstrom
    Though, keep in mind, you'll likely have to "fix" the consoles of any other computer that runs it too... that can be a pain on distribution. To be honest, I have no idea how to use a specific Unicode set in C++ as I'm from the US and our alphabet is adequately supported by ASCII.

    You could always google it.
    In general it's compiler/OS-specific. In MS VC++/Win32 you can't even output Unicode with std::wcout, you need to call the WriteConsole() API function to output Unicode characters, EVEN if those characters exist in the default system codepage.
    You ever try a pink golf ball, Wally? Why, the wind shear on a pink ball alone can take the head clean off a 90 pound midget at 300 yards.

  9. #9
    (?<!re)tired Mario F.'s Avatar
    Join Date
    May 2006
    Location
    Ireland
    Posts
    8,446
    > You could always google it.

    It is still a pain to code for Unicode
    It made me buy a book.
    Originally Posted by brewbuck:
    Reimplementing a large system in another language to get a 25% performance boost is nonsense. It would be cheaper to just get a computer which is 25% faster.

  10. #10
    Registered User
    Join Date
    May 2003
    Posts
    1,619
    Quote Originally Posted by Mario F.
    > You could always google it.

    It is still a pain to code for Unicode
    It made me buy a book.
    Hmm, I should write a book

    I do think I'll post a Unicode tutorial on the Windows forum, though. I have quite a bit of experience working with it.
    You ever try a pink golf ball, Wally? Why, the wind shear on a pink ball alone can take the head clean off a 90 pound midget at 300 yards.

  11. #11
    (?<!re)tired Mario F.'s Avatar
    Join Date
    May 2006
    Location
    Ireland
    Posts
    8,446
    > Google tells me how to make the console show acents characters, but i have no idea of how to config my msvs to use "ISO 8859-1 or ANSI 1252 Latin 1".

    It's somewhere on the editor options or somthing. Look around there for "codepage"... or "locale" maybe (doubt it).

    But do remember that this is just so that you can actually see the portuguese characters in the editor. Chances are the editor is already configured for ANSI 1252. Cat advise meanwhile is easy to skip, but very important. Avoid string literals like the one I shown you. That was just an example to address another issue. Store them in files instead and load them at run time.
    Originally Posted by brewbuck:
    Reimplementing a large system in another language to get a 25% performance boost is nonsense. It would be cheaper to just get a computer which is 25% faster.

  12. #12
    (?<!re)tired Mario F.'s Avatar
    Join Date
    May 2006
    Location
    Ireland
    Posts
    8,446
    Quote Originally Posted by Cat
    Hmm, I should write a book

    I do think I'll post a Unicode tutorial on the Windows forum, though. I have quite a bit of experience working with it.
    Darn! Do that, when you can

    I'm always surpised at the near lack of information regarding Unicode programming when you hear everywhere how important it should be. One of those inconsistencies roughtly scratching the "Do as I say, don't do as I do".
    Originally Posted by brewbuck:
    Reimplementing a large system in another language to get a 25% performance boost is nonsense. It would be cheaper to just get a computer which is 25% faster.

  13. #13
    Registered User
    Join Date
    Apr 2006
    Posts
    2,149
    system("graftabl [xxx]") should allow you to change the codepage of your console. where [xxx] is replaced by the codepage number.
    It is too clear and so it is hard to see.
    A dunce once searched for fire with a lighted lantern.
    Had he known what fire was,
    He could have cooked his rice much sooner.

  14. #14
    carry on JaWiB's Avatar
    Join Date
    Feb 2003
    Location
    Seattle, WA
    Posts
    1,972
    Quote Originally Posted by Cat
    Hmm, I should write a book

    I do think I'll post a Unicode tutorial on the Windows forum, though. I have quite a bit of experience working with it.
    That sounds like a good idea to me. Or maybe even write an article/series of articles and maybe we can get some activity on the articles discussions board
    "Think not but that I know these things; or think
    I know them not: not therefore am I short
    Of knowing what I ought."
    -John Milton, Paradise Regained (1671)

    "Work hard and it might happen."
    -XSquared

  15. #15
    Devil's Advocate SlyMaelstrom's Avatar
    Join Date
    May 2004
    Location
    Out of scope
    Posts
    4,079
    Quote Originally Posted by King Mir
    system("graftabl [xxx]")
    *barf*
    Sent from my iPad®

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. how many old school DOS programmers are left?
    By Waldo2k2 in forum A Brief History of Cprogramming.com
    Replies: 23
    Last Post: 02-01-2003, 05:14 PM
  2. File systems?? (Winxp -> DOS)
    By Shadow in forum Tech Board
    Replies: 4
    Last Post: 01-06-2003, 09:08 PM
  3. Crazy Characters?!
    By Unregistered in forum C Programming
    Replies: 2
    Last Post: 01-22-2002, 02:02 PM
  4. DOS Characters
    By Unregistered in forum C++ Programming
    Replies: 2
    Last Post: 12-29-2001, 02:08 PM