I need to programatically change the encoding of a set of *nix scripts to UTF-8 from Java. I won't write anything to them, so I'm trying to find what's the easiest|fastest way to do this. The files are not too many and are not that big. I could:
- "Write" an empty string using an OutputStream with UTF-8 set as encoding
- Since I'm already using FileUtils (from Apache Commons), I could read|write the contents of these files, passing UTF-8 as encoding
Not a big deal, but has anyone run into this case before? Are there any cons on either approach?