space out wrote:
>
> Hi all,
>
> I wrote the codes below to display Japanese
> Currency, but I got
>
> ?1,000,000
>
> WHY? any help or hint is appreciated greatly!
>
> Thank you!
>
> ----------------------------
> import java.text.*;
> import java.util.*;
>
> class NumberFormatApp1 {
>  public static void main(String args[]) {
>   Locale l=new Locale("ja","JP");
>   NumberFormat format = NumberFormat.getCurrencyInstance(
>    l);
>   String formattedCurrency = format.format(1000000);
>   System.out.println(formattedCurrency);
>  }
> }

You need a Japanese font to display Japanese symbols. System.out.println()
writes to the command window where you run the program, and it typically
can not display other than Latin-1 characters.

Since this is the JSP-INTEREST list, I assume what you really want is to
send the Japanese text to a browser. You must then use the page directive
and the contentType attribute to specify the charset used to encode the
Japanese symbols, e.g.:

  <%@ page contentType="text/html;charset=Shift_JIS" %>

The browser must also be configured with a Japanese font.

Hans
--
Hans Bergsten           [EMAIL PROTECTED]
Gefion Software         http://www.gefionsoftware.com

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets

Reply via email to