Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 4 of 4

Thread: Input Japanese from Website

  1. #1
    Junior Member
    Join Date
    Nov 2011
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Input Japanese from Website

    Hi,
    Im trying to get japanese text from a website. Here is the code I used to get english text successfully:

    BufferedReader in = new BufferedReader(new InputStreamReader(websiteURL.openStream()));

    while ((inputLine = in.readLine()) != null) {

    }


    The japense text input I'm getting now looks like this:

    �N���K�l�����Z���^�[�J���[�����Ȏ��オ

    As you can see alot of the japanese characters are being converted into '�'. I looked at the uni-code value and they are the same (65533) so I know its not just a display problem.

    Any help and understanding of this problem, will be appreciated!


  2. #2
    Administrator copeg's Avatar
    Join Date
    Oct 2009
    Location
    US
    Posts
    5,318
    Thanks
    181
    Thanked 833 Times in 772 Posts
    Blog Entries
    5

    Default Re: Input Japanese from Website

    This thread has been cross posted here:

    http://www.java-forums.org/networking/51344-japanese-input-internet.html

    Although cross posting is allowed, for everyone's benefit, please read:

    Java Programming Forums Cross Posting Rules

    The Problems With Cross Posting


  3. #3
    Think of me.... Mr.777's Avatar
    Join Date
    Mar 2011
    Location
    Pakistan
    Posts
    1,136
    My Mood
    Grumpy
    Thanks
    20
    Thanked 82 Times in 78 Posts
    Blog Entries
    1

    Default Re: Input Japanese from Website

    Quote Originally Posted by chris2547 View Post
    Hi,
    Im trying to get japanese text from a website. Here is the code I used to get english text successfully:

    BufferedReader in = new BufferedReader(new InputStreamReader(websiteURL.openStream()));

    while ((inputLine = in.readLine()) != null) {

    }


    The japense text input I'm getting now looks like this:

    �N���K�l�����Z���^�[�J���[�����Ȏ��オ

    As you can see alot of the japanese characters are being converted into '�'. I looked at the uni-code value and they are the same (65533) so I know its not just a display problem.

    Any help and understanding of this problem, will be appreciated!
    Store Unicodes in an arraylist or somewhere (you could access), get the unicode, compare it with the stored unicodes and place the character to the output.

  4. #4
    Junior Member
    Join Date
    Nov 2011
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: Input Japanese from Website

    Quote Originally Posted by Mr.777 View Post
    Store Unicodes in an arraylist or somewhere (you could access), get the unicode, compare it with the stored unicodes and place the character to the output.
    I have tried that, but when I get the unicode from the website its already been changed to '�'. I tried getting one byte at a time

    BufferedReader in = new BufferedReader(new InputStreamReader(oracle[0].openStream()), 1);

    int data = in.read();
    char theChar = (char) data;

    and I had the same problem. The japanese characters unicode have already all been changed.

Similar Threads

  1. Game website
    By doby162 in forum The Cafe
    Replies: 3
    Last Post: March 16th, 2011, 07:08 AM
  2. [SOLVED] allow a new input, dicarding the last mismatch input without terminating the program
    By voltaire in forum What's Wrong With My Code?
    Replies: 2
    Last Post: April 9th, 2010, 04:44 AM
  3. Problem with Japanese Encoding
    By sendhilpk in forum File I/O & Other I/O Streams
    Replies: 0
    Last Post: January 12th, 2010, 02:57 AM
  4. Website Source
    By expertOpinion in forum Java Theory & Questions
    Replies: 10
    Last Post: July 21st, 2009, 11:06 AM
  5. Replies: 3
    Last Post: March 9th, 2009, 09:47 AM

Tags for this Thread