Community
Participate
Working Groups
import java.nio.charset.Charset;
import org.eclipse.swt.graphics.Color;
import org.eclipse.ui.WorkbenchEncoding;
import org.eclipse.ui.internal.console.IOConsolePartitioner;
import org.eclipse.ui.internal.console.StreamDecoder;
* @param encoding encoding identifier
*/
public void setEncoding(String encoding) {
Charset charset = Charset.forName(encoding);
String charsetName;
if (encoding == null) {
charsetName = WorkbenchEncoding.getWorkbenchDefaultEncoding();
} else {
charsetName = encoding;
}
Charset charset = Charset.forName(charsetName);
try {
this.setCharset(charset);
} catch (IOException ioe) {