[android-beginners] Re: illegal characer in URI ?

2010-02-14 Thread -DC-
How are you creating the URL? Try one of these methods: path = URLEncoder.encode("finance.yahoo.com/q/hp?s=^DJI", "UTF-8"); uri = new URI("http://"; + path); ...or... uri = new URI("http", "finance.yahoo.com", "/q/hp?s=^DJI", ""); On Feb 13, 11:55 pm, ivanchan wrote: > Hi all, > > I am trying

[android-beginners] Re: illegal characer in URI ?

2010-02-14 Thread Indicator Veritatis
RFC2396 does list '^' as one of the 'unwise' characters. The inference is that '^' should be escaped, though the RFC does not say so explicitly. The Java API docs on URI and URLencode, OTOH, recommend always using URI rather than URLEncode, converting from URI to URL only as needed, using toURL.

[android-beginners] Re: illegal characer in URI ?

2010-02-15 Thread Indicator Veritatis
Judging from all the sample code ignoring the recommendation, I'd say not many people did know. That is why I posted the quote from the API docs. OTOH, it is a mild nuisance that URI throws URISyntaxException, which isn't even an IOException. So I suspect the desire to avoid dealing with this is t

[android-beginners] Re: illegal characer in URI ?

2010-02-15 Thread ivanchan
thanks all for the feedback, Using uri = new URI("http", "finance.yahoo.com", "/q/hp?s=^DJI", ""); , I got 404 not found, Using path = URLEncoder.encode("finance.yahoo.com/q/hp?s=^DJI", "UTF-8"); uri = new URI("http://"; + path); I got E/AndroidRuntime( 311): Caused by: java.lang.IllegalArgumentE

[android-beginners] Re: illegal characer in URI ?

2010-02-15 Thread -DC-
More info: http://java.sun.com/docs/books/tutorial/networking/urls/creatingUrls.html On Feb 15, 11:29 am, ivanchan wrote: > thanks all for the feedback, > > Usinguri= newURI("http", "finance.yahoo.com", "/q/hp?s=^DJI", > ""); , > I got 404 not found, > Using path = URLEncoder.encode("finance.yaho

Re: [android-beginners] Re: illegal characer in URI ?

2010-02-14 Thread Kevin Duffey
Good info Indicator.. I did not read both APIs to know that either was better than the other... for URIs this is good to know. On Sun, Feb 14, 2010 at 3:44 PM, Indicator Veritatis wrote: > RFC2396 does list '^' as one of the 'unwise' characters. The inference > is that '^' should be escaped, thou

Re: [android-beginners] Re: illegal characer in URI ?

2010-02-14 Thread Clint Tredway
sent from my nexus one On Feb 14, 2010 6:24 PM, "Kevin Duffey" wrote: Good info Indicator.. I did not read both APIs to know that either was better than the other... for URIs this is good to know. On Sun, Feb 14, 2010 at 3:44 PM, Indicator Veritatis wrote: > > RFC2396 does l... -- You rece