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 CString init from &#XXXX;&#YYYY; representation

Unicode CString init from &#XXXX;&#YYYY; representation

Scheduled Pinned Locked Moved C / C++ / MFC
questionhelptutorial
3 Posts 2 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.
  • L Offline
    L Offline
    lob
    wrote on last edited by
    #1

    Hi, I store texts in file in following unicode representation : &#XXXX;&#YYYY; This string & # 1058; & #1077; & #1089; & #1090; ,for example , means "Test" in russian. My project is built as unicode and i can successfully show this string if i do following: CString strMsg; strMsg = (unsigned short) 1058; strMsg += (unsigned short) 1077; strMsg += (unsigned short) 1089; strMsg += (unsigned short) 1090; TextOutW(....,..,..,..,strMsg,..,..); My question is : what should i do in order to init string like this : Code: CString strText = "& # 1058; & # 1077; & #1089; & #1090;"; so that it will be "treated" as unicode string ? I tried _T("& # 1058; & # 1077; & #1089; & #1090;") , but it doesn't help.. NOTE - I USED SPACES IN ABOVE POST INSIDE UNICODE STRINGS ON PURPOSE TO PREVENT THEM TO APPEAR AS RUSSIAN CHARS

    I 1 Reply Last reply
    0
    • L lob

      Hi, I store texts in file in following unicode representation : &#XXXX;&#YYYY; This string & # 1058; & #1077; & #1089; & #1090; ,for example , means "Test" in russian. My project is built as unicode and i can successfully show this string if i do following: CString strMsg; strMsg = (unsigned short) 1058; strMsg += (unsigned short) 1077; strMsg += (unsigned short) 1089; strMsg += (unsigned short) 1090; TextOutW(....,..,..,..,strMsg,..,..); My question is : what should i do in order to init string like this : Code: CString strText = "& # 1058; & # 1077; & #1089; & #1090;"; so that it will be "treated" as unicode string ? I tried _T("& # 1058; & # 1077; & #1089; & #1090;") , but it doesn't help.. NOTE - I USED SPACES IN ABOVE POST INSIDE UNICODE STRINGS ON PURPOSE TO PREVENT THEM TO APPEAR AS RUSSIAN CHARS

      I Offline
      I Offline
      includeh10
      wrote on last edited by
      #2

      unclear question: CString strText = "& # 1058; & # 1077; & #1089; & #1090;"; do you mean values in the string: first byte is: '&' second byte is: '#' next 2 bytes are: 1058 etc? includeh10

      L 1 Reply Last reply
      0
      • I includeh10

        unclear question: CString strText = "& # 1058; & # 1077; & #1089; & #1090;"; do you mean values in the string: first byte is: '&' second byte is: '#' next 2 bytes are: 1058 etc? includeh10

        L Offline
        L Offline
        lob
        wrote on last edited by
        #3

        No, I mean unicode representation of string. Т = 'T' , е = 'e' , с = 's' ; т = 't' (in russian)

        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