Call iconv from Ruby 1.8.7 through system to convert a file from utf-16 to utf-8
问题 Here's what I got: path_js = 'path/to/a/js/file.js' path_new_js = 'path/where/the/converted/file/should/go.js' puts('iconv -f utf-16le -t utf-8 ' + path_js + ' > ' + path_new_js) system('iconv -f utf-16le -t utf-8 ' + path_js + ' > ' + path_new_js) The output of the puts statement is: iconv -f utf-16le -t utf-8 path/to/1-1-2_E1_MC105.js > compiled/path/to/1-1-2_E1_MC105.js If I copy-paste that exact same line in my terminal the conversion takes place successfully but when it runs inside my