Visual C++ and UNICODE - _t macros

This is a discussion on Visual C++ and UNICODE - _t macros within the Windows Programming forums, part of the Platform Specific Boards category; VC 6 has a lot of macros that begin with _t that map to ANSI functions normally and to UNICODE ...

  1. #1
    the hat of redundancy hat nvoigt's Avatar
    Join Date
    Aug 2001
    Location
    Hannover, Germany
    Posts
    3,139

    Visual C++ and UNICODE - _t macros

    VC 6 has a lot of macros that begin with _t that map to ANSI functions normally and to UNICODE functions when _UNICODE is defined.

    Example:

    isalpha is the normal ANSI function
    iswalpha is the wide (UNICODE) function

    _istalpha is a macro that is mapped to either isalpha or iswalpha depending on the _UNICODE/UNICODE compiler flag. So far, so good.

    I just found out the hard way, that _tolower is NOT a UNICODE mapping of tolower and/or towlower.

    Now, how do you create a lower case character from an uppercase character when you don't know if you will have UNICODE or not when compiling ? Obviously you can write your own #ifdef of _UNICODE, but that's ugly and plain dumb when the other 99% of character mapping functions already has macros.

    Anyone else having problems with this ?
    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.

  2. #2
    Registered User Codeplug's Avatar
    Join Date
    Mar 2003
    Posts
    4,651

  3. #3
    the hat of redundancy hat nvoigt's Avatar
    Join Date
    Aug 2001
    Location
    Hannover, Germany
    Posts
    3,139
    Oh, there is _totlower. Funny, no mention of it in my helpfile under tolower or towlower. Even if I type _totlower I only get the entries for the original two without any hints.

    Well, thanks a lot, I guess I was just blind
    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.

Popular pages Recent additions subscribe to a feed

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