Characters like á ő ü in DOS

This is a discussion on Characters like á ő ü in DOS within the C++ Programming forums, part of the General Programming Boards category; Is possible to somehow write those special characters in DOS? (Sorry but i forgot the english name of them). Because ...

  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,069
    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
    Portugal
    Posts
    7,434
    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.
    The programmer’s wife tells him: “Run to the store and pick up a loaf of bread. If they have eggs, get a dozen.”
    The programmer comes home with 12 loaves of bread.


    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
    Cat
    Cat is offline
    Registered User
    Join Date
    May 2003
    Posts
    1,571
    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,069
    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
    Cat
    Cat is offline
    Registered User
    Join Date
    May 2003
    Posts
    1,571
    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
    Portugal
    Posts
    7,434
    > You could always google it.

    It is still a pain to code for Unicode
    It made me buy a book.
    The programmer’s wife tells him: “Run to the store and pick up a loaf of bread. If they have eggs, get a dozen.”
    The programmer comes home with 12 loaves of bread.


    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
    Cat
    Cat is offline
    Registered User
    Join Date
    May 2003
    Posts
    1,571
    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
    Portugal
    Posts
    7,434
    > 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.
    The programmer’s wife tells him: “Run to the store and pick up a loaf of bread. If they have eggs, get a dozen.”
    The programmer comes home with 12 loaves of bread.


    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
    Portugal
    Posts
    7,434
    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".
    The programmer’s wife tells him: “Run to the store and pick up a loaf of bread. If they have eggs, get a dozen.”
    The programmer comes home with 12 loaves of bread.


    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,023
    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,069
    Quote Originally Posted by King Mir
    system("graftabl [xxx]")
    *barf*
    Sent from my iPad®

Page 1 of 2 12 LastLast
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, 04:14 PM
  2. File systems?? (Winxp -> DOS)
    By Shadow in forum Tech Board
    Replies: 4
    Last Post: 01-06-2003, 08:08 PM
  3. extract characters to '.'
    By VanJay011379 in forum C++ Programming
    Replies: 5
    Last Post: 07-29-2002, 11:32 PM
  4. Crazy Characters?!
    By Unregistered in forum C Programming
    Replies: 2
    Last Post: 01-22-2002, 01:02 PM
  5. DOS Characters
    By Unregistered in forum C++ Programming
    Replies: 2
    Last Post: 12-29-2001, 01:08 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21