JAVA Doclet Error unamppable character for encoding UTF8

315 Views Asked by At

I need to run this javadoc program for the java file specified below. When i run it i will get the following error message:

Error: unmappable character for encoding UTF8

After several research I found that this error is happening when it finds special characters (the documentation of your java file), and i can get rid of them but that is not an optimal solution.

My question is, is there a way to process the file with any special characters included in your Java file? Have tried to use different econders but cant find the right one.

Special characters being used (" ", -, ©, °, ⌐)

public class JavaDoclet {

/** The current doc, which in this app is a single java file. */
private static RootDoc currentDoc;
/**
 * @param args the command line arguments
 */
public static void main(String[] args) {
    System.out.println("==========START DOCLET=========");
    String[] cmds = {"-private",
                         "-doclet", JavaDoclet.class.getName(), 
                         "-docletpath", "javadocgrade",
                         "-encoding", "UTF-8",
                         "C:\\Users\\julio\\DispModel.java"};
    int c = com.sun.tools.javadoc.Main.execute(cmds);
    System.out.println("print c -> " + c); //Returns a 1 if it didnt get executed || processed

}

public static boolean start(RootDoc root){

    currentDoc = root;
    ClassDoc[] classes = currentDoc.classes();
   //String tagName = "@param";
    for (int i = 0; i < classes.length; i++){
        System.out.println(classes[i]);

    }
    return true;
}   
0

There are 0 best solutions below