try {
customername = new String(request.getParameter("customername").getBytes("ISO-8859-1"), "UTF-8");
customerlastname = new String(request.getParameter("customerlastname").getBytes("ISO-8859-1"),"UTF-8");
} catch(Exception e) { //this generic but you can control another types of exception
// look the origin of excption
}