<html><body> <form method=post action="Mojibake"> <input type=input name="a"> <input type=submit value="pushIt"> </form> </body></html> |
import java.io.*; import javax.servlet.http.*; public class Sat extends HttpServlet { public void service ( HttpServletRequest request, HttpServletResponse response ) throws ServletException, IOException { try { response.setContentType( "text/html" ); String a = new String((request.getParameter("a")).getBytes("8859_1"),"Shift_JIS"); System.out.println( a ); } catch( Exception e ) { } } // service method ends... } // class block ends... |