Results 1 to 2 of 2
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 ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
- 01-28-2013 #1Just Joined!
- Join Date
- Jan 2012
- Posts
- 9
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");
to
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
Vikas
- 01-30-2013 #2Linux Newbie
- Join Date
- Dec 2011
- Posts
- 122
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.


Reply With Quote
