j2me inputStreamReader problem with 6600

Login to reply to this topic.
Wed, 2005-05-25 06:02
Joined: 2003-12-20
Forum posts: 85
hi to all


HttpConnection hc = (HttpConnection)Connector.open(url);
InputStream is = hc.openInputStream();
hi to all

Reader reader = new InputStreamReader(is,"UTF8");

i have a file in url with unicode characters, it sees that inputstreamreader is giving me the error with UTF8 on Series60 nokia 6600 set. without "UTF8" in inputstreamreader it is working good.

plz tell me what is wrong with it.
with best regards
kmsoomro


Tue, 2005-06-28 16:37
Joined: 2005-06-28
Forum posts: 3
Re: j2me inputStreamReader problem with 6600
try to change "UTF8" to "UTF-8"...

I was doing something similar with the second variant, it has worked...

Thu, 2005-09-08 07:29
Joined: 2005-08-29
Forum posts: 30
Re: j2me inputStreamReader problem with 6600
hi!
for data read or write with the help of UTF you can involve use these steps:

Read data:-
DataInputStream in = new DataInputStream( new ByteArrayInputStream( data ) ); //for read data
read(in)
public void read( DataInputStream in ) throws IOException {
abc    = in.readUTF();      
}

write data:-
ByteArrayOutputStream out = new ByteArrayOutputStream();
DataOutputStream dout = new DataOutputStream( out );
try {
write( dout, ob );   //write data
}catch(Exception e){}
public void write( DataOutputStream out ) throws IOException {
out.writeUTF(abc);
}
bye!
kksidhu
  • Login to reply to this topic.