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. Help: ASCII to UNICODE convertion?

Help: ASCII to UNICODE convertion?

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

    Hello, Is there an easy way to convert from ASCII code to Unicode? assumes: i have some text written in other encoding like cyrillic, i want to convert it to UNICODE? i am using visual c++ 6.0. could somebody give any advice? thanks

    D M F 3 Replies Last reply
    0
    • G Gofur Halmurat

      Hello, Is there an easy way to convert from ASCII code to Unicode? assumes: i have some text written in other encoding like cyrillic, i want to convert it to UNICODE? i am using visual c++ 6.0. could somebody give any advice? thanks

      D Offline
      D Offline
      David Crow
      wrote on last edited by
      #2

      Gofur Halmurat wrote:

      Is there an easy way to convert from ASCII code to Unicode?

      You mean like the A2W() macro?


      "Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman

      "To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne

      G 1 Reply Last reply
      0
      • D David Crow

        Gofur Halmurat wrote:

        Is there an easy way to convert from ASCII code to Unicode?

        You mean like the A2W() macro?


        "Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman

        "To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne

        G Offline
        G Offline
        Gofur Halmurat
        wrote on last edited by
        #3

        i dont know what A2W macro is? how can i use it? thanks

        D 1 Reply Last reply
        0
        • G Gofur Halmurat

          Hello, Is there an easy way to convert from ASCII code to Unicode? assumes: i have some text written in other encoding like cyrillic, i want to convert it to UNICODE? i am using visual c++ 6.0. could somebody give any advice? thanks

          M Offline
          M Offline
          markkuk
          wrote on last edited by
          #4

          The first 127 code points of the Unicode character set equal the ASCII character set, so you can simply assign each ASCII character to a wide Unicode character.

          Gofur Halmurat wrote:

          i have some text written in other encoding like cyrillic, i want to convert it to UNICODE?

          "cyrillic" isn't an encoding. You must know the actual character set used to encode the cyrilic text, is it ISO-8859-5, Windows CP1251, KOI-8, or something else? Once you know that you can use for example iconv[^] to do the conversion.

          G 1 Reply Last reply
          0
          • M markkuk

            The first 127 code points of the Unicode character set equal the ASCII character set, so you can simply assign each ASCII character to a wide Unicode character.

            Gofur Halmurat wrote:

            i have some text written in other encoding like cyrillic, i want to convert it to UNICODE?

            "cyrillic" isn't an encoding. You must know the actual character set used to encode the cyrilic text, is it ISO-8859-5, Windows CP1251, KOI-8, or something else? Once you know that you can use for example iconv[^] to do the conversion.

            G Offline
            G Offline
            Gofur Halmurat
            wrote on last edited by
            #5

            You are right, it is Windows CP1251, i want to change it to UTF-8, but how? i read some about iconv, i think that is only under linux os, even if it is under windows, could you give me an example of how to use it? i am really lost of c++ type casting. there are alot of types in c++ thanks

            1 Reply Last reply
            0
            • G Gofur Halmurat

              Hello, Is there an easy way to convert from ASCII code to Unicode? assumes: i have some text written in other encoding like cyrillic, i want to convert it to UNICODE? i am using visual c++ 6.0. could somebody give any advice? thanks

              F Offline
              F Offline
              Fernando A Gomez F
              wrote on last edited by
              #6

              Use MultiByteToWideChar[^] and WideCharToMultiByte[^], respectively.


              Hope is the negation of reality - Raistlin Majere

              1 Reply Last reply
              0
              • G Gofur Halmurat

                i dont know what A2W macro is? how can i use it? thanks

                D Offline
                D Offline
                David Crow
                wrote on last edited by
                #7

                See here.


                "Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman

                "To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne

                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