Skip to content

Commit

Permalink
Log the error when the encoding doesn't exist.
Browse files Browse the repository at this point in the history
  • Loading branch information
xuhdev committed Apr 26, 2013
1 parent ffa2d36 commit d4ea8ee
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/org/editorconfig/jedit/EditorConfigPlugin.java
Expand Up @@ -37,6 +37,7 @@
import org.gjt.sp.jedit.EditBus;
import org.gjt.sp.jedit.EditPlugin;
import org.gjt.sp.jedit.buffer.JEditBuffer;
import org.gjt.sp.jedit.io.EncodingServer;
import org.gjt.sp.jedit.msg.BufferUpdate;
import org.gjt.sp.util.Log;

Expand Down Expand Up @@ -177,9 +178,16 @@ else if (ecConf.charset.equals("latin1"))
charset = "US-ASCII";
else if (ecConf.charset.equals("utf-8-bom"))
charset = "UTF-8Y";
else // Other unknown charset
Log.log(Log.ERROR, this,
"Unrecognized charset: charset=" + ecConf.charset);
}
else if (ecConf.jeditCharset != null)
charset = ecConf.jeditCharset;
if(EncodingServer.hasEncoding(ecConf.jeditCharset))
charset = ecConf.jeditCharset;
else
Log.log(Log.ERROR, this,
"Unrecognized charset jedit_charset=" + ecConf.jeditCharset);

// if we have a valid charset and the charset is different from the
// current one, we set it and disable the encoding auto detection
Expand Down

0 comments on commit d4ea8ee

Please sign in to comment.