Results 1 to 3 of 3
  1. #1
    javastuden's Avatar
    javastuden is offline Senior Member
    Join Date
    Nov 2009
    Posts
    162
    Rep Power
    6

    Default 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

  2. #2
    arun9683 is offline Member
    Join Date
    Jun 2010
    Location
    Bangalore,India
    Posts
    70
    Rep Power
    0

    Default

    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
    :)

  3. #3
    javastuden's Avatar
    javastuden is offline Senior Member
    Join Date
    Nov 2009
    Posts
    162
    Rep Power
    6

    Default

    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

  1. running a java application on Japanese OS
    By yibingdong in forum Advanced Java
    Replies: 4
    Last Post: 09-09-2009, 11:01 PM
  2. Replies: 0
    Last Post: 04-19-2009, 07:38 PM
  3. Displaying Japanese characters in JSP page
    By jmanjunath in forum Advanced Java
    Replies: 1
    Last Post: 09-25-2008, 12:19 PM
  4. Seach with a japanese charecter via get method
    By nimitha in forum New To Java
    Replies: 1
    Last Post: 07-10-2008, 05:16 PM
  5. reading text character by character
    By bugger in forum New To Java
    Replies: 2
    Last Post: 11-09-2007, 09:54 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •