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. Displaying text in non-english language on console [modified]

Displaying text in non-english language on console [modified]

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.
  • C Offline
    C Offline
    ComplexLifeForm
    wrote on last edited by
    #1

    Hi, I am trying to display non-english text on the std console. I have tried various methods like setconsole, _wsetconsole etc.. Defined _UNICODE and UNICODE macros also used wstring, wcout thinking that wide char variant might print the non-english text. Below is my sample program #include #include using namespace std; int_tmain() { wstring nonEnglishName = _TEXT("槧雲鼻"); wcout.imbue(locale("jpn"); wcout << _TEXT("Name in japanese is = ") << nonEnglishName.c_str() << endl; return 0; } The output I am getting is = Name in japanese is = ₧▀ë_ò@ My system locate is still set to US_ENGLSH and I do not want to change it. Can anybody please guide me regarding the correct procedure for displaying non-english text on the console? Thanks -- modified at 13:46 Wednesday 12th September, 2007

    M 1 Reply Last reply
    0
    • C ComplexLifeForm

      Hi, I am trying to display non-english text on the std console. I have tried various methods like setconsole, _wsetconsole etc.. Defined _UNICODE and UNICODE macros also used wstring, wcout thinking that wide char variant might print the non-english text. Below is my sample program #include #include using namespace std; int_tmain() { wstring nonEnglishName = _TEXT("槧雲鼻"); wcout.imbue(locale("jpn"); wcout << _TEXT("Name in japanese is = ") << nonEnglishName.c_str() << endl; return 0; } The output I am getting is = Name in japanese is = ₧▀ë_ò@ My system locate is still set to US_ENGLSH and I do not want to change it. Can anybody please guide me regarding the correct procedure for displaying non-english text on the console? Thanks -- modified at 13:46 Wednesday 12th September, 2007

      M Offline
      M Offline
      Matthew Faithfull
      wrote on last edited by
      #2

      Check out the SetConsoleCP and GetConsoleCP API functions.

      Nothing is exactly what it seems but everything with seems can be unpicked.

      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