We Java developers may often encounter unmappable Character for Encoding errors. The reason for this error is that the source code contains characters not included in the GBK encoding. The solution: The source code contains characters not included in the GBK encoding.
• delete the character
• save the source code file as utf-8 encoding
unmappable character for encoding error. However, after looking it up on the Internet, we know that the class file of Java USES utf-8 encoding. Test2.java is compiled to Test2.class, including the utF-8 encoding conversion process.
solution
copy code | copy code | |
compile javac-encoding GBK test2. Java runs java-dfile.encoding = “GBK” test2 |
3
Read More:
- OpenProj can’t open or prompt “Failed to load Java VM Library” error solution
- [resolved] error: Java: illegal character: ‘\ ufef’ or error: Java: class, interface or enum required
- Java.lang.Character . isdigit() and isletter() methods
- Unicode encodeerror: ‘GBK’ codec can’t encode character solution
- Java String.split () special character processing
- Solving syntax error: unexpected character after line continuation character
- Syntax error: unexpected character after line continuation character
- Error: the solution to the illegal character ‘\ ufeff’
- Error querying database.Cause:java.sql.SQLSyntaxErrorException:ORA-00911:invalid character
- Front end project construction error unexpected character ‘@’ solution
- The solution of eclipse code automatic prompt function
- To solve the idea compilation error: error: (1,1) Java: illegal character: ‘\ UFF’
- Visual studio 2017, OpenGL program running prompt glut32.dll missing solution
- Solution to the problem that SQL database query result field contains new line character, which leads to copy to excel dislocation
- org.apache.jasper.JasperException: Unsupported encoding:
- Prompt “The MSI failed” solution when uninstalling VMware
- [Linux] solution: SCP different server copy file prompt permission denied, please try again
- IOS prompt revoke certificate solution
- Java:java.lang.OutOfMemoryError : GC overhead limit exceeded solution
- Command prompt window prompt system error 5, access denied?