Find the answer to your Linux question:
Results 1 to 2 of 2
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1

    displaying hindi in linux command prompt

    Hi Experts

    I want to display "hindi" string on command terminal of Linux, I used

    setlocale(LC_ALL, "hi_IN.utf8");

    By using it I am able to display the hindi string.

    but this funciton sometime work and some time won't work,

    because I found one time it was working, but if I use the same funciton again, I found it is displaying "hindi string" with values such as

    ??????? for each character, when I toggle from

    setlocale(LC_ALL, "hi_IN.utf8");


    setlocale(LC_ALL, "en_US.UTF-8");

    It start displaying hindi string as well.

    Can anybody suggest me the correct way or where I am wrong;
    1)I would like to display hindi or english on my linux command terminal with user choice.
    2)I would like to write information in Hindi as well as English too.
    English file saved in the correct format, but hindi file saved with some e.g "Ÿ‡स"

    Thanks & Regards

  2. #2
    Linux Enthusiast
    Join Date
    Dec 2011
    Turtle Island West
    Excellent question, and I wish I had the perfect answer.

    My best guess:

    After you change locale, you might need to re-initialize the terminal. It might be like having one terminal for hindi, and one for english. I'm not so sure you can just flick a switch like that. The terminal has been set for a certain locale when it started, and that's where it sits. But I could be wrong.

    Good luck. You have asked the exact question that programmers have been battling with for years. I hope someone else has a better answer.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts