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. About CEdit::LineLength

About CEdit::LineLength

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

    Hello everyone: I program code in Japanese OS. And I found that CEdit::LineLength() can not return total bytes of one line. The function returns total character number of one line. Example: 1. "1234日本90" --->>> LineLength -> 8 2. "1234567890" --->>> LineLength -> 10 About Example 1, it should return 10 but the result is 8. Is it right? or I need to set up something? Thanks. -Freehawk

    D 1 Reply Last reply
    0
    • F freehawk

      Hello everyone: I program code in Japanese OS. And I found that CEdit::LineLength() can not return total bytes of one line. The function returns total character number of one line. Example: 1. "1234日本90" --->>> LineLength -> 8 2. "1234567890" --->>> LineLength -> 10 About Example 1, it should return 10 but the result is 8. Is it right? or I need to set up something? Thanks. -Freehawk

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

      I do not know an exact answer to your problem, but I'm fairly certain it is Unicode related. With Unicode, each character consumes two bytes, which is why example 1 is two bytes short of what you expect. You might try defining both UNICODE and _UNICODE in your project's stdafx.h file.


      "Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow

      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