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. Extracting a Chinese Character from a CString

Extracting a Chinese Character from a CString

Scheduled Pinned Locked Moved C / C++ / MFC
questionlearning
4 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.
  • W Offline
    W Offline
    wow9999
    wrote on last edited by
    #1

    Dear all CString aStr="Learning 中文"; //a mixed English and Chinese string Without using Unicode, How can i extract the Chinese Character word by word from a Mixed English and Chinese string? Thanks

    M 1 Reply Last reply
    0
    • W wow9999

      Dear all CString aStr="Learning 中文"; //a mixed English and Chinese string Without using Unicode, How can i extract the Chinese Character word by word from a Mixed English and Chinese string? Thanks

      M Offline
      M Offline
      Michael Dunn
      wrote on last edited by
      #2

      To find the double-byte characters, step through one char at a time and call IsDBCSLeadByte() on each one. When that function returns true, that char and the following one make up one double-byte character.

      W 1 Reply Last reply
      0
      • M Michael Dunn

        To find the double-byte characters, step through one char at a time and call IsDBCSLeadByte() on each one. When that function returns true, that char and the following one make up one double-byte character.

        W Offline
        W Offline
        wow9999
        wrote on last edited by
        #3

        Thank you. can you tell me how to make a one double-bye character?

        M 1 Reply Last reply
        0
        • W wow9999

          Thank you. can you tell me how to make a one double-bye character?

          M Offline
          M Offline
          Michael Dunn
          wrote on last edited by
          #4

          I'm not sure I know what you're asking. You just put the two bytes one after the other. --Mike-- Ericahist | Homepage | RightClick-Encrypt | 1ClickPicGrabber CP SearchBar v2.0.2 released

          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