vijos/vj4

Chinese character output not supported?

wlnirvana opened this issue · 4 comments

Example (It seems the link can be accessed by NON-DOMAIN members)

Code:

import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		System.out.println("你好");

	}

}

Self-test input (cannot be left empty):

1

Self-test output:

你好

Verdict: WA

twd2 commented

You can use UTF-8 encoding for output since the answer file is in UTF-8 encoding:

import java.util.Scanner;
import java.io.PrintStream;

public class Main {
	public static void main(String[] args) throws java.io.UnsupportedEncodingException {
		PrintStream ps = new PrintStream(System.out, true, "UTF-8");
		ps.println("你好");
	}
}

and then get AC.

twd2 commented

So there is an issue for https://github.com/vijos/jd4 that what the default encoding is and why it is not UTF-8.

Not necessarily the entire jd4 engine, as this appears to be a Java-only issue. Just tested against C and Python, and both got AC.

twd2 commented

You can open an issue for jd4 to file this problem.

Closing, while you can still feel free to reopen this issue if you have any updates.