Unable to display Japenese Characters
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Shreenivas_Bon
Posted On:   Tuesday, August 27, 2002 06:25 PM

I am unable display Japanese Characters

By the following code.

Locale france = new Locale("fr", "FR");
String language = france.getDisplayLanguage(new Locale("ja","JP");

This is printing like ????

Where as it is working foe German, Spanish, French languages but not for Japanese language. What should I need to do to print Japanese characters. I am using IE and encoding has been set to UTF-8

Please give me advice

Re: Unable to display Japenese Characters

Posted By:   Jorgen_Nordqvist  
Posted On:   Tuesday, August 27, 2002 08:12 PM

That is not the way to display Japanese characters. The purpose of getDisplayLanguage() is to display the name of a locale in a country specific language. In your example above, it should display the French name for Japan. Below is a snippet from the Javadocs that explains the use of this method fully:


public String getDisplayLanguage(Locale inLocale)


Returns a name for the locale's language that is appropriate for display to the user. If possible, the name returned will be localized according to inLocale. For example, if the locale is fr_FR and inLocale is en_US, getDisplayLanguage() will return "French"; if the locale is en_US and inLocale is fr_FR, getDisplayLanguage() will return "anglais". If the name returned cannot be localized according to inLocale, (say, we don't have a Japanese name for Croatian), this function falls back on the default locale, on the English name, and finally on the ISO code as a last-resort value. If the locale doesn't specify a language, this function returns the empty string.


If you wish to display Japanese characters in your browser then you need to set the correct HTTP headers, typically the content-type and charset headers.

Jorgen

About | Sitemap | Contact