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 conversion problem(slovak characters)

Unicode conversion problem(slovak characters)

Scheduled Pinned Locked Moved C / C++ / MFC
helptutorial
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.
  • V Offline
    V Offline
    Vineet Kumar
    wrote on last edited by
    #1

    Hi, I am writing an application, which required unicode conversion, but I am facing some problem with SLOVAK characters. For example, I face the problem for character ď , whose value is ď for conversion, I did the following: string strNum = "271"; wchar_t lpszUcode[1]; lpszUcode[0] = atoi(strNum.c_str()); int nCodePage = 1252; int iBuffLen = WideCharToMultiByte(nCodePage, NULL, lpszUcode, 1, NULL, 0, NULL, NULL); char* buffer = new char[iBuffLen + 1]; WideCharToMultiByte(nCodePage, NULL, lpszUcode, 1, buffer, iBuffLen, NULL, NULL); buffer[iBuffLen] = 0; string strRes = buffer; It returns with the value d rather than ď . can somene pl. sugeeset the solution for this. Regards Tough Time Never last, but Tough People do.

    S 1 Reply Last reply
    0
    • V Vineet Kumar

      Hi, I am writing an application, which required unicode conversion, but I am facing some problem with SLOVAK characters. For example, I face the problem for character ď , whose value is ď for conversion, I did the following: string strNum = "271"; wchar_t lpszUcode[1]; lpszUcode[0] = atoi(strNum.c_str()); int nCodePage = 1252; int iBuffLen = WideCharToMultiByte(nCodePage, NULL, lpszUcode, 1, NULL, 0, NULL, NULL); char* buffer = new char[iBuffLen + 1]; WideCharToMultiByte(nCodePage, NULL, lpszUcode, 1, buffer, iBuffLen, NULL, NULL); buffer[iBuffLen] = 0; string strRes = buffer; It returns with the value d rather than ď . can somene pl. sugeeset the solution for this. Regards Tough Time Never last, but Tough People do.

      S Offline
      S Offline
      Stuart Dootson
      wrote on last edited by
      #2

      Vineet Kumar wrote:

      int nCodePage = 1252;

      Code page 1252 doesn't contain that character, so it translates to the nearest equivalent that is in hte code page - which is "d".

      Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p

      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