Mailing List Archive

Support open source code!


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: tlug: Japanese encoding converters



Hi Jonathan,

Jonathan wrote:
> Does anybody know of any nice, reliable programs that will batch convert
> Japanese-encoded HTML files?  My greatest need is for converting between
> Shift-JIS and EUC.  One that works recursively and can automatically seek
> out every file in the directory structure it's aimed at would be especially
> welcome.

You may want ONE nice program to do that.  But isn't it enough for you
to do it with 'find' and 'nkf', although it may be slow?

Prepare a (C-)shell script like: 

htmlconvert
----------------------------
#!/bin/csh -f

set tmp = /tmp/htmlconvert.$$

nkf -e $1 > $tmp
mv $tmp $1
----------------------------

and put it in your bin directory, then invoke this:

    find . -name '*.html' -exec htmlconvert {} \;


I think 'nkf' can't make output file with the same name as input
file.  If so, we should use 'nkf' via script or try to write multiple
commands between "-exec" and "\;".  I'm not sure how to do with the
latter way.


Regards,
Smiley
--
Masanori "Smiley/Smack" Omote
work: omote@example.com
home: masa@example.com
--------------------------------------------------------------
Next Nomikai: 15 May Fri, 19:30 Tengu TokyoEkiMae 03-3275-3691
Next TLUG Meeting: 13 June Sat, Tokyo Station Yaesu gate 12:30
Featuring Stone and Turnbull on .rpm and .deb packages
--------------------------------------------------------------
Sponsor: PHT, makers of TurboLinux http://www.pht.co.jp


Home | Main Index | Thread Index

Home Page Mailing List Linux and Japan TLUG Members Links