Yebisu Blog (in Japanese) shows a following snippet.
#!/usr/bin/env ruby
require "nkf"
print NKF.nkf('-Ew -m0 -x', open(ENV['TM_FILEPATH']).read)
You need to have nkf installed to use this command. The snippet above converts EUC into UTF-8.
My problem, where I see a diamond-like character at the end of each line (at least when I try to convert Shift-JIS to UTF-8, still exists. I can still use “Remove Unprintable Characters in Document / Selection” in Text Bundle. Does anybody know how this removal affects the file?