txtENC.setText("");
String decData = txtDEC.getText();
String charName = cboCharset.getText();
String encData = "";
URLCodec uc = new URLCodec();
try {
encData = uc.encode(decData, charName);
} catch (UnsupportedEncodingException e1) {
e1.printStackTrace();
}
txtENC.append(encData);
}
@Override
public void widgetDefaultSelected(SelectionEvent e) {
}
});
btnDEC.addSelectionListener(new SelectionListener() {
@Override
public void widgetSelected(SelectionEvent e) {
txtDEC.setText("");
String encData = txtENC.getText();
String charName = cboCharset.getText();
String decData = "";
URLCodec uc = new URLCodec();
try {
decData = uc.decode(encData, charName);
} catch (UnsupportedEncodingException e1) {
e1.printStackTrace();
} catch (DecoderException e1) {
e1.printStackTrace();
}