File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Java in General and the fly likes Problem in displaying Asian languages in Internationalization Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "Problem in displaying Asian languages in Internationalization" Watch "Problem in displaying Asian languages in Internationalization" New topic
Author

Problem in displaying Asian languages in Internationalization

clyde melly
Ranch Hand

Joined: Sep 04, 2003
Posts: 152
I have written a small application to display web page in different languages like french,german etc but with asian languages it's giving problem while making property files(i.e not able to save the property files).So plz tell how to overcome this problem and is there any editor which will directly translate the variables in property files.My code is as following.



package sfa;
//import for ResourceBundle class;
import java.util.*;
import sfa.*;
public class InternalizationBean
{

public static Internalization getMessageForView(Internalization oInternalization)
{
//Internalization oInternalization=new Internalization();
String language=oInternalization.getMyLanguage();
String country=oInternalization.getMyCountry();

String sMess1="";
String sMess2="";
String sMess3="";

Locale currentLocale;
ResourceBundle messages;

try
{
currentLocale=new Locale(language,country);
messages=ResourceBundle.getBundle("sfa.MessageBundle",currentLocale);

sMess1=messages.getString("greetings");
sMess2=messages.getString("inquiry");
sMess3=messages.getString("farewell");


oInternalization.setMess1(sMess1);
oInternalization.setMess2(sMess2);
oInternalization.setMess3(sMess3);

}
catch (Exception e)
{
System.out.println(e);
}

return oInternalization;
}
}
Jim Hicks
Greenhorn

Joined: Jun 23, 2004
Posts: 11
The problem with storing the data in a file may be your file system setup. If your computer file system is setup to only store 8 bit chars, then saving 16 bit chars in a file will result in unreadable data. Java chars are 16 bit but by default, they are converted to your computer's file systems char set which is usually 8 bit for western systems. In version 4 of Java, they made handling of charsets easier.

I would recommend you goto:

http://java.sun.com/developer/technicalArticles/Intl/index.html

Also when you write the html out, you need to make sure you set the html charset to something like "UTF-8". Setting it to ISO-8859-1 will limit you to 8 bits.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Problem in displaying Asian languages in Internationalization