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. Multi language support in MBCS application

Multi language support in MBCS application

Scheduled Pinned Locked Moved C / C++ / MFC
debuggingjsonquestion
4 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.
  • V Offline
    V Offline
    Varghese Paul M
    wrote on last edited by
    #1

    Hi Friends, I have a dialog based MBCS application which creates the EDIT control over the dialog using CreateWindowExW API to support languages like Chinese, Japanese etc. When I paste the Chinese characters into the EDIT control, it displays it correctly. I call the GetWindowTextW to extract the content from the control into a wchar_t buffer. But the debugger is not showing the value unless I call CharToOemW. What CharToOem does on that buffer? I would like to know more details with a functional comparison of APIs, WideCharToMultiByte and CharToOem. Thank you

    cheers Varghese Paul

    J _ L 3 Replies Last reply
    0
    • V Varghese Paul M

      Hi Friends, I have a dialog based MBCS application which creates the EDIT control over the dialog using CreateWindowExW API to support languages like Chinese, Japanese etc. When I paste the Chinese characters into the EDIT control, it displays it correctly. I call the GetWindowTextW to extract the content from the control into a wchar_t buffer. But the debugger is not showing the value unless I call CharToOemW. What CharToOem does on that buffer? I would like to know more details with a functional comparison of APIs, WideCharToMultiByte and CharToOem. Thank you

      cheers Varghese Paul

      J Offline
      J Offline
      Jijo Raj
      wrote on last edited by
      #2

      Please check whether you have enabled - "Display Unicode strings" option under Tools > Options > Debug tab. Regards, Jijo.

      _____________________________________________________ http://weseetips.com[^] Visual C++ tips and tricks. Updated daily.

      1 Reply Last reply
      0
      • V Varghese Paul M

        Hi Friends, I have a dialog based MBCS application which creates the EDIT control over the dialog using CreateWindowExW API to support languages like Chinese, Japanese etc. When I paste the Chinese characters into the EDIT control, it displays it correctly. I call the GetWindowTextW to extract the content from the control into a wchar_t buffer. But the debugger is not showing the value unless I call CharToOemW. What CharToOem does on that buffer? I would like to know more details with a functional comparison of APIs, WideCharToMultiByte and CharToOem. Thank you

        cheers Varghese Paul

        _ Offline
        _ Offline
        _Superman_
        wrote on last edited by
        #3

        All multi-byte functions work on char buffers and not on wchar_t buffers.

        «_Superman_»

        1 Reply Last reply
        0
        • V Varghese Paul M

          Hi Friends, I have a dialog based MBCS application which creates the EDIT control over the dialog using CreateWindowExW API to support languages like Chinese, Japanese etc. When I paste the Chinese characters into the EDIT control, it displays it correctly. I call the GetWindowTextW to extract the content from the control into a wchar_t buffer. But the debugger is not showing the value unless I call CharToOemW. What CharToOem does on that buffer? I would like to know more details with a functional comparison of APIs, WideCharToMultiByte and CharToOem. Thank you

          cheers Varghese Paul

          L Offline
          L Offline
          Lost User
          wrote on last edited by
          #4

          Varghese Paul M wrote:

          But the debugger is not showing the value unless I call CharToOemW. What CharToOem does on that buffer?

          I think that the CharToOEM function is converting the string buffer from UTF-8 into the default codepage on your operating system. Code Page Identifiers[^] Code Pages[^] Code page[^] Best Wishes, -David Delaune

          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