package com.ygtx.common.utils;
import java.io.PrintStream;

public class Utf8MainTemplate {
    public static void fixEncoding() {
        try {
            System.setProperty("file.encoding", "UTF-8");
            System.setProperty("sun.stdout.encoding", "UTF-8");
            System.setProperty("sun.stderr.encoding", "UTF-8");
            System.setOut(new PrintStream(System.out, true, "UTF-8")); // 旧 JDK 可用，但会抛 UnsupportedEncodingException
            System.setErr(new PrintStream(System.err, true, "UTF-8"));
        } catch (Exception ignored) {}
    }
}
