Results 1 to 3 of 3
Thread: japanese character in jsp page
- 07-14-2010, 06:52 AM #1
japanese character in jsp page
HI all,
i had a problem
i'm using struts2 ,tomcat6,mysql 'version', '5.2.3-falcon-alpha-community-nt'
java 1.6.0_04
in the jsp pages there is username and password field as the user enter the japanese character it has check with db's table and show all the user (that is the list of values in table in next page)all as in japanes characters .
i used page encoding UTF-8 in the jsp page but its not working in db's table its latin1 coding as default and also some ??????? is storing in the table .the client side validation also has to be in japanes char also
what all steps do i need to get my probelm solved
please any give me a full description with example please
Thanks in advance
- 07-16-2010, 10:43 AM #2
Member
- Join Date
- Jun 2010
- Location
- Bangalore,India
- Posts
- 70
- Rep Power
- 0
Not understanding your problem completely..
If your problem is to display the results in the Japanese then you can use Resource Bundles and property Files for Japanese language support....
Or
You can also make use of google translator API.Arun K R,Bangalore,India
:)
- 11-11-2010, 11:29 AM #3
hi
now i'm back in the same point but the problem is same
there is a property file name XXX.propertires in that there is a key with value in japanes char
i has to read that and display that in the same format in console
my code is
package main;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.UnsupportedEncodingException;
import java.net.URL;
import java.util.Locale;
import java.util.Properties;
import java.util.ResourceBundle;
import javax.swing.JButton;
import javax.swing.JLabel;
import org.apache.log4j.Logger;
public class Testencoding {
public static void main(String[] args) throws UnsupportedEncodingException, IOException {
/*Properties props = new Properties();
*
lo
URL resource = Testencoding.class.getClassLoader().getResource("d ata.properties");
props.load(new InputStreamReader(resource.openStream(), "UTF8"));*/
Locale currentLocale = Locale.JAPANESE;
System.out.println( currentLocale ); // e.g. en_CA
Logger log=Logger.getLogger("Testencoding");
// select the ResourceBundle closest fit to this locale
// note, you don't specifiy the .properties or _en_CA
// A corresponding resource might be called MyResources_en_CA.properties
// Unlike ordinary resources handling, getBundle will
// not prepend the package name on the resource automatically.
ResourceBundle myResources =
ResourceBundle.getBundle( "CaptureApp",currentLocale );
// you retrieve the localised string with a unique key string.
JButton okButton = new JButton( myResources.getString( "OkButtonLabel" ));
JLabel hoursLabel = new JLabel( myResources.getString( "hours" ));
System.out.println( okButton.getText() ); // e.g. Eh?
System.out.println( hoursLabel.getText() ); // e.g. HH
log.info(hoursLabel.getText());
System.out.println("Encoding: " + System.getProperty("file.encoding")
+ ", Language: " + System.getProperty("user.language"));
}
}
Similar Threads
-
running a java application on Japanese OS
By yibingdong in forum Advanced JavaReplies: 4Last Post: 09-09-2009, 10:01 PM -
To display chinese/japanese language Character filename - Java Programming
By bngkrish in forum Java ServletReplies: 0Last Post: 04-19-2009, 06:38 PM -
Displaying Japanese characters in JSP page
By jmanjunath in forum Advanced JavaReplies: 1Last Post: 09-25-2008, 11:19 AM -
Seach with a japanese charecter via get method
By nimitha in forum New To JavaReplies: 1Last Post: 07-10-2008, 04:16 PM -
reading text character by character
By bugger in forum New To JavaReplies: 2Last Post: 11-09-2007, 08:54 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks