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
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. about MBCS and unicode in Visual C++ 2005

about MBCS and unicode in Visual C++ 2005

Scheduled Pinned Locked Moved C / C++ / MFC
c++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.
  • D Offline
    D Offline
    DSPCottage
    wrote on last edited by
    #1

    Dear all I have a project which can be both compiled with VC6 and VC 2005 When I compile it by VC6, the content of LPCSTR is one byte per character but when I compile the project under VC2005 , I find that each character of LPCSTR is consist of 2 bytes which first byte contains the character data and second byte contains a "0" in it. thus I cant show the data properly as I want what happened under VC2005 could you please help me how I can overcome this problem. Is is about unicode and MCBS How can I disable it under VC2005 Could you please send me an article for this problem. I want to become more familiar with UNICODE thanks in advance Mahdi

    C _ 2 Replies Last reply
    0
    • D DSPCottage

      Dear all I have a project which can be both compiled with VC6 and VC 2005 When I compile it by VC6, the content of LPCSTR is one byte per character but when I compile the project under VC2005 , I find that each character of LPCSTR is consist of 2 bytes which first byte contains the character data and second byte contains a "0" in it. thus I cant show the data properly as I want what happened under VC2005 could you please help me how I can overcome this problem. Is is about unicode and MCBS How can I disable it under VC2005 Could you please send me an article for this problem. I want to become more familiar with UNICODE thanks in advance Mahdi

      C Offline
      C Offline
      Code o mat
      wrote on last edited by
      #2

      I never used 2005, but in 2003 you can right-click your project in solution explorer, select Properties, under General you can set the the character set between unicode, MBCS and unset which basicly means simple, everyday, 1 byte per char strings.

      > The problem with computers is that they do what you tell them to do and not what you want them to do. < > Life: great graphics, but the gameplay sux. <

      modified on Saturday, March 7, 2009 4:21 PM

      1 Reply Last reply
      0
      • D DSPCottage

        Dear all I have a project which can be both compiled with VC6 and VC 2005 When I compile it by VC6, the content of LPCSTR is one byte per character but when I compile the project under VC2005 , I find that each character of LPCSTR is consist of 2 bytes which first byte contains the character data and second byte contains a "0" in it. thus I cant show the data properly as I want what happened under VC2005 could you please help me how I can overcome this problem. Is is about unicode and MCBS How can I disable it under VC2005 Could you please send me an article for this problem. I want to become more familiar with UNICODE thanks in advance Mahdi

        _ Offline
        _ Offline
        _Superman_
        wrote on last edited by
        #3

        Yes, it is about UNICODE and MBCS as you correctly suspected. VC6 by default does not use UNICODE, but VC 2005 used UNICODE as the default. You can disable this through Project -> Properties -> Configuration Properties -> General -> Character Set. Here you can choose between UNICODE and MBCS. On the other side, you can show the data or do any manipulation on UNICODE characters. You just need to use the wide version of the functions or the _t macros.

        «_Superman_» I love work. It gives me something to do between weekends.

        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