Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

In order to make this conversion I have to use a text editor. This is tedious. Is there an easier way to do it, like some program I can run from the Linux or OSX terminal?

share|improve this question
    
If your target is Window's Shift_JIS, you should use CP932 instead if you are having problems converting some characters. –  lepe Jun 6 '13 at 3:08

2 Answers 2

up vote 8 down vote accepted

To convert from Shift JIS to UTF-8 on linux just do:

iconv -f SHIFT-JIS -t UTF-8 <infile> > <outfile>

and to go the other way just reverse the arguments:

iconv -f UTF-8 -t SHIFT-JIS <infile> > <outfile>

I don't know OSX but it may well have the iconv command as well, in which case something similar should work.

share|improve this answer

I use the following command:

SHIFT-JIS to UTF-8

nkf -w <infile> > <Outfile>

UTF-8 to SHIFT-JIS

nkf -s <infile> > <Outfile>

NKF - Network Kanji code conversion Filter

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.