游客:  注册 | 登录 | 首页
作者:
标题: 请教海雨等技术高手一个问题 上一主题 | 下一主题
thesunlover

#1  请教海雨等技术高手一个问题

For Yidian renovation purpose, I need to search Chinese words under Unix shell by using tools like grep. How can I convert Chinese words such as 原创 to English text which can be recognized by Unix shell?

Thank you in advance!



因为我和黑夜结下了不解之缘 所以我爱太阳
2009-1-4 00:15
博客  资料  短信   编辑  引用

searain

#2  

As a matter of fact, my unix shell knowledge is limited.  And I have never used Chinese (or chinese encoding) in unix scripts.


2009-1-4 02:17
博客  资料  短信   编辑  引用

恕敌

#3  



引用:
Originally posted by thesunlover at 2009-1-4 05:15 AM:
For Yidian renovation purpose, I need to search Chinese words under Unix shell by using tools like grep. How can I convert Chinese words such as 原创 to English text which can be recognized by Unix..

It is not easy to make "grep" work with Chinese. So don't try it.

The best way to do it is to write Perl Scripts. You can also write Java programs.

You don't translate Chinese word to English in order to perform search. Chinese words is just a different coding scheme. You probably need to change the encoding and language setting of your Unix/Linux Shell to make the perl script work.


2009-1-4 23:07
博客  资料  信箱 短信   编辑  引用

晨思

#4  

http://heather.cs.ucdavis.edu/~matloff/Chinese/ChineseComp/Chinix.html

check and see see if this article helps or not. i did google 'search chinese under unix' to find, try it.  Google might be the best to find good answers on tech issues. Good luck.


2009-1-4 23:52
博客  资料  信箱 短信   编辑  引用

章凝

#5  

Thanks everyone for the info and suggestions

It seems there isn't an easy or lazy way to do the job. It may not be worth to spend too much time and effort finding a solution under Unix shell. I am now thinking to use Dreamwaver or any webpage editor to search Chinese words in php and html files. Another way is to use Google searching PC files (I forgot the Google desktop tool name). What do you think?



我的黑暗是一湖水,我的光明是一条鱼
2009-1-5 00:43
博客  资料  短信   编辑  引用

« 上一主题 综合类 下一主题 »