On Thu, 13 Dec 2001, Jagan K Samuel wrote: > Dear All, > I want to output a particular mathematical operator to a > file. This operator looks like the '=' sign but has one more '-', > underneath the other two. The unicode number seems to be 2261. How can > I > 1. show this character as it is using system.out.println() > 2. output this to a file. > > regards > Jagan >
"System.out.println("\u2261");" Should work. Incidentally, your question got me wondering if I could do Unicode from servlets, and view the results in normal browsers. I have a test servlet for Unicode now. You have to install the language packs for Greek, Hebrew, Japanese etc. This is easily done from Internet Explorer->View->Encoding->More->Hebrew. It will then prompt for the Windows 2000 disc and install the language fonts. After the language packs are installed through Internet Explorer, the servlet works in Opera 6 and Netscape 6 as well. Clearly this could be translated to JSP easily. Incidentally, you can do one extra language at a time if you set the charset to ISO-8859-1 or ISO-8859-7, etc depending of course on which language you want, and if the language fonts are on your computer. Michael Akerman ---- import java.io.*; import javax.servlet.*; import javax.servlet.http.*; public class UnicodeServlet extends HttpServlet { public void doGet (HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException { res.setContentType("text/html; charset=UTF-8"); PrintWriter out = res.getWriter(); out.println("<html>"); out.println("<head><meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\"></head>"); out.println("<body>"); out.println("<table width=80% style='font: bold 14pt Times'>"); for(int i=0x0030; i<=0x00ff; i++) { if ( i % 16 == 0 ) out.println("<tr>"); out.print("<td>"); out.write(i); } for(int i=0x0370; i<=0x03ff; i++) { if ( i % 16 == 0 ) out.println("<tr>"); out.print("<td>"); out.write(i); } for(int i=0x3040; i<=0x30ff; i++) { if ( i % 16 == 0 ) out.println("<tr>"); out.print("<td>"); out.write(i); } for(int i=0x0590; i<=0x05ff; i++) { if ( i % 16 == 0 ) out.println("<tr>"); out.print("<td>"); out.write(i); } out.println("</table>"); out.println("</body>"); out.println("</html>"); } } =========================================================================== To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST". For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST". Some relevant FAQs on JSP/Servlets can be found at: http://archives.java.sun.com/jsp-interest.html http://java.sun.com/products/jsp/faq.html http://www.esperanto.org.nz/jsp/jspfaq.jsp http://www.jguru.com/faq/index.jsp http://www.jspinsider.com