Article View: borland.public.jbuilder.java.language
Article #8226Re: Unicode Conversion - Help
From: Harry Whitehouse
Date: Sun, 15 Apr 2001 20:37
Date: Sun, 15 Apr 2001 20:37
41 lines
2747 bytes
2747 bytes
John and Joi! You guys were right!! Moving to DataInputStream worked like a charm!! Don't know why it took two days of beating my head on the wall, however <g>. Thanks SO much!!!!! Harry "John McGrath [TeamB]" <ng-b@JPMcGrath.net> wrote in message news:MPG.154159e6664fc4d098a124@forums.borland.com... > On Fri, 13 Apr 2001 12:23:34 -0700, Harry Whitehouse wrote: > > > InputStreamReader MyInputStream > > = new InputStreamReader(uc.getInputStream()); > > I think this is where your problem lies. > > An InputStream handles a sequence of bytes, whereas a Reader handles > a sequence of Unicode characters. When you use an InputStreamReader, > it takes the bytes from the InputStream and converts them to Unicode > characters based on the encoding set for the InputStream. This can > be set in the second argument to the InputStreamReader constructor, > and if you do not specify this, it uses the default encoding for the > platform you are running on, which is probably UTF-8. > > If the encoding if the stream is one of the standard encodings known > to your JVM, you could just specify the appropriate encoding to the > InputStreamReader constructor, and it will handle the conversion for > you. If not, you could either read the bytes from the InputStream, > or you could try defining your own converter class. But I am not > sure exactly what is involved in installing your own converter. > > -- > Regards, > > John McGrath [TeamB] > > --------------------------------------------------- > Before sending me e-mail, please read: > http://www.JPMcGrath.net/newsgroups/e-mail.html
Technical Details
Message-ID:
<3ada0693$1_1@dnews>Path:
arc1-ca.pugleaf.net!supernews.google.com!sn-xit-03!supernews.com!newsswitch.lcs.mit.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed.icl.net!dispose.news.demon.net!demon!btnet-peer0!btnet-peer1!btnet!newsfeeds.belnet.be!news.belnet.be!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!dnewsReferences:
<3ad4f06c$2_2@dnews> <MPG.154086682953719398a11d@forums.borland.com> <3ad7522f$1_1@dnews> <MPG.154159e6664fc4d098a124@forums.borland.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f74b3,eba31f969c5fae3c X-Google-Attributes: gidf74b3,public X-Google-ArrivalTime: 2001-04-15 13:40:05 PST From: "Harry Whitehouse" <harry@envmgr.com> Newsgroups: borland.public.jbuilder.java.language References: <3ad4f06c$2_2@dnews> <MPG.154086682953719398a11d@forums.borland.com> <3ad7522f$1_1@dnews> <MPG.154159e6664fc4d098a124@forums.borland.com> Subject: Re: Unicode Conversion - Help Date: Sun, 15 Apr 2001 13:37:36 -0700 Lines: 43 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.50.4133.2400 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400 NNTP-Posting-Host: 38.168.115.135 Message-ID: <3ada0693$1_1@dnews> X-Trace: dnews 987367059 38.168.115.135 (15 Apr 2001 13:37:39 -0700) Path: arc1-ca.pugleaf.net!supernews.google.com!sn-xit-03!supernews.com!newsswitch.lcs.mit.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed.icl.net!dispose.news.demon.net!demon!btnet-peer0!btnet-peer1!btnet!newsfeeds.belnet.be!news.belnet.be!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!dnews