import java.lang as lang import java.io as io class MySystemOut: def __init__(self,encoding): self.pw=io.PrintWriter( io.OutputStreamWriter(lang.System.out,encoding) ) def print(self,str): self.pw.print(str) self.pw.flush() def println(self,str): self.pw.println(str) self.pw.flush() def close(self): self.pw.close() ENC="EUC-JP" MySystemOut(ENC).println("nihongo-message")