[JAVA] Minecraft Forge error: This character cannot be mapped to encoding MS932

One day, I did a modding with 1.2.5 of Minecraft Forge and it was completed, so when I recompile it

error:This character cannot be mapped to encoding MS932

I got the error. This is an error that occurs if you make a mistake in setting the character code.

This is a workaround only for Minecraft 1.6.4 and earlier.

approach

Java has an option to set the character code of the file at compile time, so use it. The java file is assumed to be UTF-8 encoded.

First, open the conf folder in the mcp directory. There is a file called "mcp.cfg" in it. When you open the file with a text editor, it goes down

mcp.cfg


CmdRecomp     = %s -Xlint:-options -deprecation -g -source 1.6 -target 1.6 -classpath "{classpath}" -sourcepath {sourcepath} -d {outpath} {pkgs}

I think there is a line that says. Please rewrite that part like this

mcp.cfg


CmdRecomp     = %s -encoding UTF-8 -Xlint:-options -deprecation -g -source 1.6 -target 1.6 -classpath "{classpath}" -sourcepath {sourcepath} -d {outpath} {pkgs}

-encoding UTF-8 was added. Save it and recompile it again and the error should disappear.

Recommended Posts

Minecraft Forge error: This character cannot be mapped to encoding MS932
Javadoc generation error: This character cannot be mapped to encoding MS932
[Java] Corrective notes for "Invalid escape character" and "Cannot map to encoding MS932"
Spring-security error message cannot be changed