• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Non-Western European Language

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi all,
i am trying to display 'Japanese text' thru my servlet code... but it does not display and result in IE. when run in Netscape 6.0 it give "500 Internal Server Error
HelloJapan: java.io.UnsupportedEncodingException: Shift-JIS "
i am attaching the code also... can anybody help me ???
Start of Code**************
import java.io.*;
import java.text.*;
import java.util.*;
import javax.servlet.*;
import javax.servlet.http.*;
public class HelloJapan extends HttpServlet {
public void doGet(HttpServletRequest req, HttpServletResponse res)
throws ServletException, IOException {
res.setContentType("text/html; charset=Shift-JIS");
PrintWriter out = res.getWriter();
res.setHeader("Content-Language","ja");
Locale locale = new Locale("ja","");
DateFormat full = DateFormat.getDateTimeInstance(DateFormat.LONG,DateFormat.LONG,locale);
out.println("In Japanese ");
out.println("\u4eca\u65e5\u306f\u4e16\u754c");
out.println(full.format(new Date()));
} //doGet
}// HelloJapan
End of Code**************

------------------
Inside of every large program is a small program struggling to get out.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic