// Collection of code snippets by Arne VajhÃ¸j 
// (likely posted to comp.os.vms/INFO-VAX, INFO-TPU, MACRO32, eksperten.dk, newz.dk, LinkedIn or other place sometime between 1990 and now) 
import java.io.File;
import java.io.IOException;
import java.io.PrintWriter;

public class J {
    public static void main(String[] args) throws IOException {
        String s1 = "ÆØÅæøå";
        String s2 = "\u00C6\u00D8\u00C5\u00E6\u00F8\u00E5";
        try(PrintWriter pw = new PrintWriter(new File("j1.txt"), "iso-8859-1")) {
            pw.printf("%s = %s\n", s1, s2);
        }
        try(PrintWriter pw = new PrintWriter(new File("j2.txt"), "utf-8")) {
            pw.printf("%s = %s\n", s1, s2);
        }
    }
}
