LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This 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


Reply
  Search this Thread
Old 03-08-2011, 07:04 AM   #1
ntu929
Member
 
Registered: Jun 2010
Location: India
Distribution: Ubuntu
Posts: 128

Rep: Reputation: 4
Reading Hindi language document from terminal


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:-

½##�##�##�##�##�##�##�##�##�##�##�##�##�##�##�##�##�##�##�##ï¿ ½##�##�##�##�###################(##*##.##0##8##:##D##F##N##P##T##V##\##^##f##h##p##r##~##� ##�###ï¿½ï¿½ï¿½ï¿½ï¿½ï¿½ï¿½ï¿½ï¿½ï¿½ï¿½ï¿½ï¿½ï¿½ï¿½ï¿½ï¿½ï¿½ï¿½ï¿½ï¿½ï¿½ï¿½ï¿½ï¿½ï¿½ï¿½ï¿½ï¿½ï¿½ï¿ ½ï¿½ï¿½ï¿½ï¿½ï¿½ï¿½ï¿½ï¿½ï¿½ï¿½ï¿½ï¿½ï¿½ï¿½ï¿½ï¿½ï¿½ï¿½ï¿½ï¿½ï¿½ï¿½ï¿½ï¿½ï¿½ï¿½ï¿½ï¿½ï¿½ï¿½ï¿½ï¿½ï¿½ ���������������������������##hi�#hi�OJ#QJ# ^J###hi�#hi�OJ#QJ#^J#[#�##�##�##�##�##�##�##�##�##�##�##�##�##�##�##�##�#####
##########6##8##<##>##H##J##R##T##X##Z##`##b##l##n##v##x##�##�###�##�##�##�##�##�##ï ¿½##�##�##�##�##�##�##�##�##�##�##�##�################ ##(##*##2##8##F##H##V##Z##h##j##r##t##x##z##�###�##�##�##�##�##�##�##�##�##ï¿½ï¿ ½ï¿½ï¿½ï¿½ï¿½ï¿½ï¿½ï¿½ï¿½ï¿½ï¿½ï¿½ï¿½ï¿½ï¿½ï¿½ï¿½ï¿½ï¿½ï¿½ï¿½ï¿½ï¿½ï¿½ï¿½ï¿½ï¿½ï¿½ï¿½ï¿½ï¿½ï¿½ï¿½ï¿½ ï¿½ï¿½ï¿½ï¿½ï¿½ï¿½ï¿½ï¿½ï¿½ï¿½ï¿½ï¿½ï¿½ï¿½ï¿½ï¿½ï¿½ï¿½ï¿½ï¿½ï¿½ï¿½ï¿½ï¿½ï¿½ï¿½ï¿½ï¿½ï¿½ï¿½ï¿½ï¿½ï¿½ï ¿½ï¿½ï¿½ï¿½ï¿½ï¿½ï¿½ï¿½ï¿½ï¿½ï¿½ï¿½ï¿½ï¿½ï¿½ï¿½ï¿½ï¿½ï¿½ï¿½ï¿½ï¿½ï¿½##hi�#hi�OJ#QJ#^J###hi�#hi �OJ#QJ#^J#[###�##8###R##�##�##�!# %#�%'##(#�(#�)##+#�+#�,#&.#�.##v0#�1#l2#Z3#�4##6##7#.8#\9#ï¿½ï¿½ï¿½ï¿½ï¿½ï¿½ï¿½ï¿½ï¿ ½ï¿½ï¿½ï¿½ï¿½ï¿½ï¿½ï¿½ï¿½ï¿½ï¿½ï¿½ï¿½ï¿½ï¿½ï¿½ï¿½ï¿½ï¿½ï¿½ï¿½##gd#W�#�##�##

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
 
Click here to see the post LQ members have rated as the most helpful post in this thread.
Old 03-08-2011, 08:27 AM   #2
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,633

Rep: Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965
Quote:
Originally Posted by ntu929 View Post
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.
 
2 members found this post helpful.
Old 03-09-2011, 04:28 AM   #3
ntu929
Member
 
Registered: Jun 2010
Location: India
Distribution: Ubuntu
Posts: 128

Original Poster
Rep: Reputation: 4
Re: Reading Hindi language document from terminal

Quote:
Originally Posted by TB0ne View Post
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 View Post
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 View Post

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 ?

Does it make any difference ?
 
Old 03-09-2011, 09:48 AM   #4
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,633

Rep: Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965
Quote:
Originally Posted by ntu929 View Post
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.
 
1 members found this post helpful.
Old 03-14-2011, 03:39 AM   #5
ntu929
Member
 
Registered: Jun 2010
Location: India
Distribution: Ubuntu
Posts: 128

Original Poster
Rep: Reputation: 4
Re: Reading Hindi language document from terminal

Quote:
Originally Posted by TB0ne View Post
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.

What should be done ?
 
Old 03-14-2011, 09:51 AM   #6
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,633

Rep: Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965
Quote:
Originally Posted by ntu929 View Post
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.
 
1 members found this post helpful.
Old 03-14-2011, 10:16 AM   #7
davholla
Member
 
Registered: Jun 2003
Location: London
Distribution: Linux Mint 13 Maya
Posts: 729

Rep: Reputation: 32
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.
 
Old 03-14-2011, 10:58 PM   #8
ntu929
Member
 
Registered: Jun 2010
Location: India
Distribution: Ubuntu
Posts: 128

Original Poster
Rep: Reputation: 4
Quote:
Originally Posted by TB0ne View Post
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 ?
 
Old 03-15-2011, 09:42 AM   #9
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,633

Rep: Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965
Quote:
Originally Posted by ntu929 View Post
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.
 
1 members found this post helpful.
Old 03-16-2011, 12:28 AM   #10
ntu929
Member
 
Registered: Jun 2010
Location: India
Distribution: Ubuntu
Posts: 128

Original Poster
Rep: Reputation: 4
Re: Reading Hindi language document from terminal

Quote:
Originally Posted by TB0ne View Post

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 View Post

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.

So how to go about developing application...
 
Old 03-16-2011, 12:52 AM   #11
Aquarius_Girl
Senior Member
 
Registered: Dec 2008
Posts: 4,731
Blog Entries: 29

Rep: Reputation: 940Reputation: 940Reputation: 940Reputation: 940Reputation: 940Reputation: 940Reputation: 940Reputation: 940
Quote:
Originally Posted by ntu929 View Post
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 View Post
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?
 
1 members found this post helpful.
Old 03-16-2011, 01:17 AM   #12
ntu929
Member
 
Registered: Jun 2010
Location: India
Distribution: Ubuntu
Posts: 128

Original Poster
Rep: Reputation: 4
Quote:
Originally Posted by Anisha Kaul View Post
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...

Regards,
ntu929
 
Old 03-16-2011, 01:29 AM   #13
Aquarius_Girl
Senior Member
 
Registered: Dec 2008
Posts: 4,731
Blog Entries: 29

Rep: Reputation: 940Reputation: 940Reputation: 940Reputation: 940Reputation: 940Reputation: 940Reputation: 940Reputation: 940
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
 
1 members found this post helpful.
Old 02-05-2013, 05:34 AM   #14
vikasmailsu
LQ Newbie
 
Registered: Mar 2010
Posts: 29

Rep: Reputation: 0
Request

Hi

I am facing the similar problem too.

I am using RedHat Enterprise Linux 4 ediiton.

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.
 
Old 02-05-2013, 08:39 PM   #15
shivaa
Senior Member
 
Registered: Jul 2012
Location: Grenoble, Fr.
Distribution: Sun Solaris, RHEL, Ubuntu, Debian 6.0
Posts: 1,800
Blog Entries: 4

Rep: Reputation: 286Reputation: 286Reputation: 286
@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...?
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
i am in trouble as i changed the language of system from english to hindi vishal17 Linux - Newbie 10 09-22-2009 06:04 AM
reading excel files in c language MiniGopal Programming 5 03-24-2009 09:09 AM
Reading OpenOffice .doc document satimis Linux - General 7 08-06-2005 09:10 AM
Reading excel files from c language rajesh_b Programming 4 11-25-2004 06:26 AM
Reading a xml document: amirspl Programming 3 09-10-2003 07:51 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 01:05 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration