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!
Re: Input Japanese from Website
Re: Input Japanese from Website
Quote:
Originally Posted by
chris2547
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.
Re: Input Japanese from Website
Quote:
Originally Posted by
Mr.777
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.