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#
  4. Unicode question

Unicode question

Scheduled Pinned Locked Moved C#
tutorialquestioncsharpc++
2 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.
  • J Offline
    J Offline
    jzb
    wrote on last edited by
    #1

    I want to do a edit usercontrol that like VC++. It can auto check user input text's length. But don't like c#,For example, "全角", it's lenthe is 4, isn't 2. How to do it?

    R 1 Reply Last reply
    0
    • J jzb

      I want to do a edit usercontrol that like VC++. It can auto check user input text's length. But don't like c#,For example, "全角", it's lenthe is 4, isn't 2. How to do it?

      R Offline
      R Offline
      Rein Hillmann
      wrote on last edited by
      #2

      Multiply the string's length value by 2. However, this is NOT indicitave of the amount of memory used by the string (length prefix etc). To get a C++ representation of what the unicode string, you will probably want to convert the string to an array of short and manipulate it like that. Use the System.Text.Encoding namespace to convert the string to and from a short array.

      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