correct definition of "_tstring"

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Gernot Frisch

    #1

    correct definition of "_tstring"

    Hi,

    I'm trying to make my code UNICODE safe, but there's not "_tstring" in the
    standard (or is there?).

    What is the best way to make it compatible with future versions of the
    standard?

    So far I use:

    #ifndef _TSTRING_DEFINE D
    #define _TSTRING_DEFINE D
    namespace std {
    typedef std::basic_stri ng<_TCHAR_tstri ng;
    };
    #endif
    std::_tstring g_mystring;


    (since this works fine with intellisense :P )


    --
    ------------------------------------
    Gernot Frisch
    GLBasic is a programming language that supports multiple platforms like e.g. iPhone


  • mlimber

    #2
    Re: correct definition of &quot;_tstring& quot;

    On Aug 19, 8:08 am, "Gernot Frisch" <m...@privacy.n etwrote:
    I'm trying to make my code UNICODE safe, but there's not "_tstring" in the
    standard (or is there?).
    There's no _tstring in the standard (the leading underscore is a good
    hint), but there is std::wstring.

    Cheers! --M

    Comment

    • Paavo Helde

      #3
      Re: correct definition of &quot;_tstring& quot;

      "Gernot Frisch" <me@privacy.net kirjutas:
      Hi,
      >
      I'm trying to make my code UNICODE safe, but there's not "_tstring" in
      the standard (or is there?).
      Unicode is an abstract mapping between numbers and characters. When used in
      programming, the numbers are stored according to some encoding of Unicode,
      like UTF-8. UTF-8 can be handled by std::string, no need for _tstring. As
      of the UTF-16 encoding currently used by Windows, it has no benefits
      whatsoever over UTF-8, IMO. I guess you are forced to use it to some extent
      if you link together with a binary library using UTF-16 in its interface
      (which is what is called "Unicode character set" by Microsoft by some
      strange reason).

      Regards
      Paavo

      Comment

      Working...