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. converting string to unicode wchar_t?

converting string to unicode wchar_t?

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

    I need to convert an ansi string to a wchar string, and I can't seem to figure out how to do this.

    R N H 3 Replies Last reply
    0
    • S Stick

      I need to convert an ansi string to a wchar string, and I can't seem to figure out how to do this.

      R Offline
      R Offline
      Rinu_Raj
      wrote on last edited by
      #2

      Try MultiByteToWideChar(..) Rinu Raj

      S 1 Reply Last reply
      0
      • R Rinu_Raj

        Try MultiByteToWideChar(..) Rinu Raj

        S Offline
        S Offline
        Stick
        wrote on last edited by
        #3

        Sorry, I must have typed the wrong question. I'm trying to convert from an ansi string to unicode.

        W 1 Reply Last reply
        0
        • S Stick

          Sorry, I must have typed the wrong question. I'm trying to convert from an ansi string to unicode.

          W Offline
          W Offline
          Waldermort
          wrote on last edited by
          #4

          You typed the same question, so the answer will be the same Use MultiByteToWideChar() or mbtowc()

          S 1 Reply Last reply
          0
          • S Stick

            I need to convert an ansi string to a wchar string, and I can't seem to figure out how to do this.

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

            if ur using ATL try its quite easy just use USES_CONVERSION; WCHAR *lpszUnicode = A2W(lpszAnsi); enjoy!

            1 Reply Last reply
            0
            • W Waldermort

              You typed the same question, so the answer will be the same Use MultiByteToWideChar() or mbtowc()

              S Offline
              S Offline
              Stick
              wrote on last edited by
              #6

              I'm not trying to convert multibyte to wide. I'm trying to convert standard ASCII (US single byte code) to Wide = Unicode. I'll look at that function in case it will do this too. I was thinking I had to use a form of sprintf

              1 Reply Last reply
              0
              • S Stick

                I need to convert an ansi string to a wchar string, and I can't seem to figure out how to do this.

                H Offline
                H Offline
                Hamid Taebi
                wrote on last edited by
                #7

                And see here[^]


                WhiteSky


                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