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. weird UNICODE problem

weird UNICODE problem

Scheduled Pinned Locked Moved C / C++ / MFC
helptutorialquestion
6 Posts 5 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.
  • A Offline
    A Offline
    Arjan Schouten
    wrote on last edited by
    #1

    Hello, I just added UNICODE support to my App and it fails to work properly. Even simple string assignments fail, I always end up with one (the first) character. example, CString s; s = _T("Test"); Now s seems to be 'T'. What's going on here?

    J J A D 4 Replies Last reply
    0
    • A Arjan Schouten

      Hello, I just added UNICODE support to my App and it fails to work properly. Even simple string assignments fail, I always end up with one (the first) character. example, CString s; s = _T("Test"); Now s seems to be 'T'. What's going on here?

      J Offline
      J Offline
      Joaquin M Lopez Munoz
      wrote on last edited by
      #2

      Try defining both UNICODE and _UNICODE in the predefined macros section. Joaquín M López Muñoz Telefónica, Investigación y Desarrollo

      1 Reply Last reply
      0
      • A Arjan Schouten

        Hello, I just added UNICODE support to my App and it fails to work properly. Even simple string assignments fail, I always end up with one (the first) character. example, CString s; s = _T("Test"); Now s seems to be 'T'. What's going on here?

        J Offline
        J Offline
        jan larsen
        wrote on last edited by
        #3

        I think the problem is in your output of the value. There are two things to remember: 1. Unicode handling is mostly limited to NT/2000 platforms. 2. If you use an ansi string function on a unicode string you will (very often) see that the function gets only the first byte of the 2 byte character. That is because the second byte is often 0x00. You say that you have added UNICODE support, does that mean that you have defined UNICODE?, then perhaps you could try defining _UNICODE as well. "After all it's just text at the end of the day. - Colin Davies "For example, when a VB programmer comes to my house, they may say 'does your pool need cleaning, sir ?' " - Christian Graus

        1 Reply Last reply
        0
        • A Arjan Schouten

          Hello, I just added UNICODE support to my App and it fails to work properly. Even simple string assignments fail, I always end up with one (the first) character. example, CString s; s = _T("Test"); Now s seems to be 'T'. What's going on here?

          A Offline
          A Offline
          Alexandru Savescu
          wrote on last edited by
          #4

          I suggest you have a look at Michael Dunn's string articles from here[^] and here[^] Best regards, Alexandru Savescu P.S. Interested in art? Visit this!

          1 Reply Last reply
          0
          • A Arjan Schouten

            Hello, I just added UNICODE support to my App and it fails to work properly. Even simple string assignments fail, I always end up with one (the first) character. example, CString s; s = _T("Test"); Now s seems to be 'T'. What's going on here?

            D Offline
            D Offline
            Daniel Turini
            wrote on last edited by
            #5

            van Padoea wrote: Now s seems to be 'T'. What's going on here? Did you see this in the debugger? Check the "Tools/Options/Debug/Display unicode strings" option My latest article: SQL Server DO's and DONT's[^]

            A 1 Reply Last reply
            0
            • D Daniel Turini

              van Padoea wrote: Now s seems to be 'T'. What's going on here? Did you see this in the debugger? Check the "Tools/Options/Debug/Display unicode strings" option My latest article: SQL Server DO's and DONT's[^]

              A Offline
              A Offline
              Arjan Schouten
              wrote on last edited by
              #6

              Doh, thank you! There was nothing wrong!

              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