Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

setContent Type to print French character from URL  RSS feed

 
aakash bhatt
Ranch Hand
Posts: 182
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
In my first Test1.JSP I am redirecting it to Test2.jsp which in URL has the French characters
<%
response.setContentType("text/html; charset=UTF-8");
response.sendRedirect("Test2.jsp?msgid=�t�");
%>
But when i print the message in Test2.jsp it prints junk characters for � which is not an english character
<%
out.println(request.getParameter("msgid"));
%>
So how can i print it in French charcter
Thanks,
aakash
 
Chris Baron
Ranch Hand
Posts: 1061
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Aakash,
try java.net.URLDecoder in Test2.jsp
<%@ page import="java.net.URLDecoder"%>
<%= URLDecoder.decode( request.getParameter("msgid"), "UTF-8" ) %>
cb
[ May 06, 2004: Message edited by: Chris Baron ]
 
Dumitru Husleag
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,
Try to put this tag in your page:
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!