Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
i having Ubuntu 10.04 Lucid Lynx at Dell laptop. i want to read documents written in hindi language. i have a font called Mangla installed in open-office that helps to read these files. But if i open them in gedit or display them by using following command, i cannot open them in readable format:-
Hi all,
i having Ubuntu 10.04 Lucid Lynx at Dell laptop. i want to read documents written in hindi language. i have a font called Mangla installed in open-office that helps to read these files. But if i open them in gedit or display them by using following command, i cannot open them in readable format:-
cat Hindi.txt output is as follows:-
i want this file should also be readable to a executable file of (CMU's toolkit).
i have installed several types of fonts such as lohit_hi.ttf. the system does seem to be recognizing this language.
Please tell how to solve this problem. ...its urgent
No, this is NOT urgent for anyone here. We volunteer our time, and answer when we want to.
You don't say what terminal program you're using, but you can specify which font to use in most of them. In Gedit, go into the preferences menu, and set the font there. If you're using the Hindi language as your desktop default, this should automatically happen...are you? If not, you will then have to specify which font(s) to use when you fire up a terminal or Gedit.
No, this is NOT urgent for anyone here. We volunteer our time, and answer when we want to.
i understand that i was strong in words (to say URGENT). Indeed people @ linuxquestions.org do things out of their love for linux os and not bound to reply to threads in any time bound manner....
Quote:
Originally Posted by TB0ne
You don't say what terminal program you're using, but you can specify which font to use in most of them.
The terminal program is from CMU university. It is called
Statistical Language Modeling Toolkit. Its specific executable is text2wfreq. This executable's help gives output as :-
text2wfreq : Generate a word frequency list for text.
Usage : text2freq [ -hash 1000000 ]
[ -verbosity 2 ]
< .text > .wfreq
After giving input as Hindi.text, the word freq file is not displayed properly. head command returns words which are not legible....
Quote:
Originally Posted by TB0ne
In Gedit, go into the preferences menu, and set the font there. If you're using the Hindi language as your desktop default, this should automatically happen...are you? If not, you will then have to specify which font(s) to use when you fire up a terminal or Gedit.
Hindi language is not present in gedits preference menus.
Also by changing the default language can it make any difference in the display at terminal ?
Can any type of fonts compliant with (UTF, UTF-8,UTF-16) be used ?
The terminal program is from CMU university. It is called
Statistical Language Modeling Toolkit. Its specific executable is text2wfreq. This executable's help gives output as :-
text2wfreq : Generate a word frequency list for text.
Usage : text2freq [ -hash 1000000 ]
[ -verbosity 2 ]
< .text > .wfreq
After giving input as Hindi.text, the word freq file is not displayed properly. head command returns words which are not legible....
As I said before, if you select that language for your desktop environment, it'll be used (along with the fonts), in other apps. If you're running a terminal session, how you specify the font to use depends on the terminal program. Putty is different from xterm, which is different from konsole, etc. What the specific program you're using requires is another matter. Read the man page and/or the documentation to find out what language support that program has.
Quote:
Hindi language is not present in gedits preference menus.
No, it wouldn't be...just the FONT would be, which would then allow the correct character set to be displayed. Again, change your desktop language environment to be Hindi, and other program will use the correct character sets accordingly.
Quote:
Also by changing the default language can it make any difference in the display at terminal ? Can any type of fonts compliant with (UTF, UTF-8,UTF-16) be used ? Does it make any difference ?
Yes, still....changing the default language changes the character set(s) used by the programs.
As I said before, if you select that language for your desktop environment, it'll be used (along with the fonts), in other apps. If you're running a terminal session, how you specify the font to use depends on the terminal program. Putty is different from xterm, which is different from konsole, etc. What the specific program you're using requires is another matter. Read the man page and/or the documentation to find out what language support that program has.
No, it wouldn't be...just the FONT would be, which would then allow the correct character set to be displayed. Again, change your desktop language environment to be Hindi, and other program will use the correct character sets accordingly.
Yes, still....changing the default language changes the character set(s) used by the programs.
Now you had said that in order to view this document, we require specifying font for this program (cat) and others which may be specific to the individual programs.
So Please tell how to go about specifying right font for this appilcation (cat).
*
As indicated earlier I have changed the default language to Hindi. But the problem still persists. If i want to read this Hindi file.
I had copied the date and day from system menu item and saved it in a file. When i view it using cat and gedit it gets opned but this paticular file is not being opened.
Now you had said that in order to view this document, we require specifying font for this program (cat) and others which may be specific to the individual programs.
So Please tell how to go about specifying right font for this appilcation (cat).
No, I did NOT say that. What I told you was that each TERMINAL program had/has a different way of specifying which font to use when you invoke it. The cat command will inherit the font set/language set from the system.
Quote:
As indicated earlier I have changed the default language to Hindi. But the problem still persists. If i want to read this Hindi file. I had copied the date and day from system menu item and saved it in a file. When i view it using cat and gedit it gets opned but this paticular file is not being opened.
What should be done ?
Then you either haven't changed the system language correctly, or the file isn't in the Hindi character set. Since you say you can open another file with Hindi information, but not THIS one, then signs point to that file being corrupted/incorrect.
What happens if you open the file but not from the terminal? Can you open it then?
If no applications can open it and you can open other files then as TB0ne says it is probably corrupted.
No, I did NOT say that. What I told you was that each TERMINAL program had/has a different way of specifying which font to use when you invoke it. The cat command will inherit the font set/language set from the system.
Then you either haven't changed the system language correctly, or the file isn't in the Hindi character set. Since you say you can open another file with Hindi information, but not THIS one, then signs point to that file being corrupted/incorrect.
yes.... i did not restart the system so there was this problem. now the terminal program (cat) is displaying the contents of this file. But the problem is that there is lack of CLARITY of words. when i use gedit to open the file, the display is more clear. the file is being opened in open-office as i had said earlier, so i dont think it is corrupt...
Any suggestions on howto improve the clarity from terminal ?
Another thing i am developing an application to display this file in java's Japplet. it is possible to display this file in a textarea ?
yes.... i did not restart the system so there was this problem. now the terminal program (cat) is displaying the contents of this file. But the problem is that there is lack of CLARITY of words. when i use gedit to open the file, the display is more clear. the file is being opened in open-office as i had said earlier, so i dont think it is corrupt...
Any suggestions on howto improve the clarity from terminal ?
Again, you STILL don't say what 'terminal' you're using, so no, we don't have any suggestions, since you don't provide details. The only thing that could make a difference, is the font...so get another Hindi font that looks better to you.
Quote:
Another thing i am developing an application to display this file in java's Japplet. it is possible to display this file in a textarea ?
Well, since it's TEXT, and you're using a TEXTAREA, then obviously you can.
Again, you STILL don't say what 'terminal' you're using, so no, we don't have any suggestions, since you don't provide details. The only thing that could make a difference, is the font...so get another Hindi font that looks better to you.
i am sorry for not divulging the details...
The terminal program is the command prompt which comes with every Linux distribution. the shell is bash scripting.
Quote:
Originally Posted by TB0ne
Well, since it's TEXT, and you're using a TEXTAREA, then obviously you can.
i think following issues will be of concern (regarding developing application to view this document):-
-The display in the application will require appropriate font to be installed.
-Also another thing is accessing the file system from local hard disk.
The terminal program is the command prompt which comes with every Linux distribution.
Many terminals come by default with many distributions, you need to be specific, if you don't know the name, tell us whether you are using Kde or Gnome or anything else? People may try to guess by that.
Xterm
Konsole
Gnome terminal
LXterminal
...
Quote:
Originally Posted by ntu929
The terminal program is from CMU university. It is called
Statistical Language Modeling Toolkit. Its specific executable is text2wfreq.
Are you not using the default Linux terminal or I am barking up the wrong tree?
Many terminals come by default with many distributions, you need to be specific, if you don't know the name, tell us whether you are using Kde or Gnome or anything else? People may try to guess by that.
Xterm
Konsole
Gnome terminal
LXterminal
...
Are you not using the default Linux terminal or I am barking up the wrong tree?
Sorry once again but let me admit that i did not know the name of this terminal program and the desktop is gnome environment..
yes i am using default linux terminal. i sorry for not providing the correct info. But i need to display this using default linux terminal.
the program of text2wfreq from CMU univ runs on this default terminal program. This program (text2wfreq) now accepts this document( written in hindi).
As told by TBONE, i was installed hindi as the default language and now some display of the hindi document is there but there is lack of clarity. my ubuntu version is 10.04. Can you suggest some good font (as told by TBONE) i have tried some free fonts such as JanakHindi font from CDAC, Mangla font.
Once again sorry for lack of proper communication...
Now I realize, you mentioned Ubuntu in your OP and Ubuntu by default uses Gnome and Gnome by default uses "Gnome terminal" which can also be started by the command gnome-terminal.
Hit out Google with the keywords: Devanagari fonts
and then with the keywords: installing Windows fonts in Linux
I would like to open a file which contain hindi string ,
I make changes in the bashrc and bash_profile to set
export LANG=hi_IN.UTF-8
and restart the system, then I try to open the said file in Linux using cat command
It working fine.
But when I run the user created application(c++ program) that generate Hindi messages on terminal as well as create a hindi file . The hindi file is genearted successfully, but hindi messages are not coming in terminal.
So I used setLocale function inside my c++ application, it resolved the problem. But I would like to know
Is there any other way by which I can display Hindi message on terminal with my user created c++ application without using any setlocale function.
I notice one more thing I can display hindi file without setting
export LANG=hi_IN.UTF-8
in bashrc and bash_profile where my current language is English .
Thanks & Regards
Vikas
Last edited by vikasmailsu; 02-05-2013 at 06:09 AM.
@vikasmailsu:
Please continue with your new post (here). You can update the same in new post.
However, did you check whether character encoding for hindi is available in your terminal/desktop environment (Open a terminal > Open Terminal tab > Set Character Encoding > Add or Remove)?
Also what type of font's you've installed - .ttf/.otf or Postscript...?
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.