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. Arabic characters in a console window

Arabic characters in a console window

Scheduled Pinned Locked Moved C / C++ / MFC
c++help
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.
  • H Offline
    H Offline
    Hosam Aly Mahmoud
    wrote on last edited by
    #1

    I want to create a console application (using Visual C++ 6.0) that can input and output Arabic characters. I tried the following code:

    #define UNICODE
    #include <tchar.h>
    #include <iostream>

    int main()
    {
    TCHAR in[10];
    std::wcin >> in;
    std::wcout << in;
    }

    When I run the program I try to type an Arabic word, but strange characters appear (those at the 2nd half of the ASCII table). The "cout" statement does absolutely nothing. All help would be appreciated. Thank you in advance.

    Hosam Aly Mahmoud

    J 1 Reply Last reply
    0
    • H Hosam Aly Mahmoud

      I want to create a console application (using Visual C++ 6.0) that can input and output Arabic characters. I tried the following code:

      #define UNICODE
      #include <tchar.h>
      #include <iostream>

      int main()
      {
      TCHAR in[10];
      std::wcin >> in;
      std::wcout << in;
      }

      When I run the program I try to type an Arabic word, but strange characters appear (those at the 2nd half of the ASCII table). The "cout" statement does absolutely nothing. All help would be appreciated. Thank you in advance.

      Hosam Aly Mahmoud

      J Offline
      J Offline
      Jorgen Sigvardsson
      wrote on last edited by
      #2

      I've never run any arabic (or non western for that matter) OS before, so I can only speculate. If you output only one arabic character, do you get two funny looking characters? If that's the case, it seems that the console is not UNICODE at all. If there's a 1:1 ratio between arabic characters and funny looking characters, then I'd assume that the font used in the console does not have the arabic letters. -- 20 eyes in my head, they're all the same![^]

      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