Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. UNICODE support suggetions required

UNICODE support suggetions required

Scheduled Pinned Locked Moved C / C++ / MFC
helpquestion
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • K Offline
    K Offline
    krishnakumartm
    wrote on last edited by
    #1

    Problem: Hi Iam using std::string to do all operations with string, Now i want to support UNICODE how can i change it to UNICODE support. Thanks in advance

    ---------------------------- KRISHNA KUMAR T M

    C PJ ArendsP 2 Replies Last reply
    0
    • K krishnakumartm

      Problem: Hi Iam using std::string to do all operations with string, Now i want to support UNICODE how can i change it to UNICODE support. Thanks in advance

      ---------------------------- KRISHNA KUMAR T M

      C Offline
      C Offline
      Cedric Moonen
      wrote on last edited by
      #2

      std::string doesn't not support UNICODE. If you want to use unicode strings, you have to use std::wstring instead. If you want support for both, you will need to define your own type, something like that:

      #if defined _UNICODE || defined UNICODE
      typedef std::wstring TMyString;
      #else
      typedef std::string TMyString;
      #endif

      And then everywhere in your code you use TMyString instead of std::string.

      Cédric Moonen Software developer
      Charting control [v1.5] OpenGL game tutorial in C++

      1 Reply Last reply
      0
      • K krishnakumartm

        Problem: Hi Iam using std::string to do all operations with string, Now i want to support UNICODE how can i change it to UNICODE support. Thanks in advance

        ---------------------------- KRISHNA KUMAR T M

        PJ ArendsP Offline
        PJ ArendsP Offline
        PJ Arends
        wrote on last edited by
        #3

        http://www.codeproject.com/KB/string/tstl_h.aspx[^]


        You may be right I may be crazy -- Billy Joel -- Within you lies the power for good - Use it!

        Within you lies the power for good; Use it!

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups