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. unicode

unicode

Scheduled Pinned Locked Moved C / C++ / MFC
c++question
9 Posts 4 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.
  • R Offline
    R Offline
    radhika28
    wrote on last edited by
    #1

    I want to add multilanguage support to my mfc application.How can i proceed with it. Thanks

    N 1 Reply Last reply
    0
    • R radhika28

      I want to add multilanguage support to my mfc application.How can i proceed with it. Thanks

      N Offline
      N Offline
      Naveen
      wrote on last edited by
      #2

      to give unicode support just define _UNICODE and UNICODE in the preprocessor definition of the project settings.

      nave

      S R 2 Replies Last reply
      0
      • N Naveen

        to give unicode support just define _UNICODE and UNICODE in the preprocessor definition of the project settings.

        nave

        S Offline
        S Offline
        Stephen Hewitt
        wrote on last edited by
        #3

        And remove _MBCS.

        Steve

        R 1 Reply Last reply
        0
        • N Naveen

          to give unicode support just define _UNICODE and UNICODE in the preprocessor definition of the project settings.

          nave

          R Offline
          R Offline
          Rajesh R Subramanian
          wrote on last edited by
          #4

          Naveen R wrote:

          just define _UNICODE and UNICODE in the preprocessor definition

          Defining _UNICODE will implicitly define UNICODE.


          Nobody can give you wiser advice than yourself. - Cicero ப்ரம்மா

          N 1 Reply Last reply
          0
          • R Rajesh R Subramanian

            Naveen R wrote:

            just define _UNICODE and UNICODE in the preprocessor definition

            Defining _UNICODE will implicitly define UNICODE.


            Nobody can give you wiser advice than yourself. - Cicero ப்ரம்மா

            N Offline
            N Offline
            Naveen
            wrote on last edited by
            #5

            thanks. I didnt know that. Can u tell me where it is defined?I mean which header file have the code for that?

            nave

            R 1 Reply Last reply
            0
            • S Stephen Hewitt

              And remove _MBCS.

              Steve

              R Offline
              R Offline
              Rajesh R Subramanian
              wrote on last edited by
              #6

              Stephen Hewitt wrote:

              And remove _MBCS.

              We don't need to remove _MBCS. If we remove it, we will lose MBCS support. Just to add unicode support, defining _UNICODE will be sufficient.


              Nobody can give you wiser advice than yourself. - Cicero ப்ரம்மா

              S 1 Reply Last reply
              0
              • N Naveen

                thanks. I didnt know that. Can u tell me where it is defined?I mean which header file have the code for that?

                nave

                R Offline
                R Offline
                Rajesh R Subramanian
                wrote on last edited by
                #7

                Naveen R wrote:

                I mean which header file have the code for that?

                I don't know, but I am very sure about the point. Defining _UNICODE will implicitly define UNICODE too. I've been noticing sometimes people suggesting questioners to define both UNICODE and _UNICODE. But defining _UNICODE will suffice. I thought will point this out now.


                Nobody can give you wiser advice than yourself. - Cicero ப்ரம்மா

                N 1 Reply Last reply
                0
                • R Rajesh R Subramanian

                  Naveen R wrote:

                  I mean which header file have the code for that?

                  I don't know, but I am very sure about the point. Defining _UNICODE will implicitly define UNICODE too. I've been noticing sometimes people suggesting questioners to define both UNICODE and _UNICODE. But defining _UNICODE will suffice. I thought will point this out now.


                  Nobody can give you wiser advice than yourself. - Cicero ப்ரம்மா

                  N Offline
                  N Offline
                  Naveen
                  wrote on last edited by
                  #8

                  u r right.. i found code like this in some header file #if defined(_UNICODE) && !defined(UNICODE) #define UNICODE

                  nave

                  1 Reply Last reply
                  0
                  • R Rajesh R Subramanian

                    Stephen Hewitt wrote:

                    And remove _MBCS.

                    We don't need to remove _MBCS. If we remove it, we will lose MBCS support. Just to add unicode support, defining _UNICODE will be sufficient.


                    Nobody can give you wiser advice than yourself. - Cicero ப்ரம்மா

                    S Offline
                    S Offline
                    Stephen Hewitt
                    wrote on last edited by
                    #9

                    Defining both _UNICODE and _MBCS may cause problems if you use "tchar.h". For example many people use the _T macro and the "_t" string functions so the same code can be used for Unicode and non-Unicode builds. Take the _tcscmp function for example. Here's a table from the documentation for this function:

                    TCHAR.H routine _UNICODE & MBCS not defined _MBCS defined _UNICODE defined
                    ---------------------------------------------------------------------------
                    _tcscmp strcmp _mbscmp wcscmp

                    As you can see the results are not specified if both are defined. Already defining both leaves you in the reals of undocumented behaviour. In this case, with my header files, the Unicode version will be used. However, It's never a good idea to reply on undocumented behaviour in computer programming if you don't have a compelling reason. In general, I remove the _MBCS.

                    Steve

                    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