Thread: wchar_t and Unicode

  1. #1
    Banned Troll_King's Avatar
    Join Date
    Oct 2001
    Posts
    1,784

    wchar_t and Unicode

    This is standard C code. It is not Windows programming. I will be using this to reply to questions in a few months from now. It is appropriate for this board!

  2. #2
    the hat of redundancy hat nvoigt's Avatar
    Join Date
    Aug 2001
    Location
    Hannover, Germany
    Posts
    3,130
    hm... do you know what it is useful for ?

    Why use entirely UNICODE. It will confuse newbies.
    hth
    -nv

    She was so Blonde, she spent 20 minutes looking at the orange juice can because it said "Concentrate."

    When in doubt, read the FAQ.
    Then ask a smart question.

  3. #3
    Banned Troll_King's Avatar
    Join Date
    Oct 2001
    Posts
    1,784
    Give me a little more time to do the research, but the bits that I have read say that it is useful for developing localized code (locale). If you just use ascii character sets than basically it is only good for the english language. If you look at the C or C++ standard you'll see just how much Unicode is covered. It is about 25% of the document. I think that I want to eventually incorporate it into my code. I'll just warn a newbie that if he wants an answer without unicode he will have to convert wscanf(...) to scanf(...) and wprintf(...) to printf(...) wchar_t to char, etc. This might even be better than just giving out the whole answer all the time. It will force people to look things up and figure things out, yet have a source code to do this with.

  4. #4
    the hat of redundancy hat nvoigt's Avatar
    Join Date
    Aug 2001
    Location
    Hannover, Germany
    Posts
    3,130
    Most newbies will not understand it. You can't explain UNICODE to someone who is struggling with loops and IO. Also, writing an application all UNICODE is asking for trouble as much as writing it all ANSI.

    I know you are keen to try everything new and this is a very positive attitude, but remember not everything new is useful. Not everyone profits from using UNICODE. It's not like it cures cancer. It's just a tool. Don't force anyone to use the same tools you do.

    Please read more on UNICODE, the standards, the uses and then decide if you will use it all over your posts.

    btw: The MFC defines the _T type macros. When used properly, they let you #define _UNICODE and voila... all your code uses UNICODE.
    hth
    -nv

    She was so Blonde, she spent 20 minutes looking at the orange juice can because it said "Concentrate."

    When in doubt, read the FAQ.
    Then ask a smart question.

  5. #5
    Skunkmeister Stoned_Coder's Avatar
    Join Date
    Aug 2001
    Posts
    2,572
    Unicode is wonderful but I have to agree with nv on this. It will cause confusion.
    Free the weed!! Class B to class C is not good enough!!
    And the FAQ is here :- http://faq.cprogramming.com/cgi-bin/smartfaq.cgi

Popular pages Recent additions subscribe to a feed