Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #3547

Re: Android: create drawable from path

From Nigel Wade <nmw-news@ion.le.ac.uk>
Newsgroups comp.lang.java.programmer
Subject Re: Android: create drawable from path
Date 2011-05-05 09:39 +0100
Message-ID <92f625F2n3U1@mid.individual.net> (permalink)
References (6 earlier) <90pkrcF1aaU1@mid.individual.net> <moqdnQS2TfIcWjrQnZ2dnUVZ_s2dnZ2d@earthlink.com> <90qlgfFt2vU1@mid.individual.net> <o4ednUsm87v17DXQnZ2dnUVZ_vmdnZ2d@earthlink.com> <92dgnmF3ciU1@mid.individual.net>

Show all headers | View raw


On 04/05/11 18:29, Dirk Bruere at NeoPax wrote:
> Any suggestions as to why this url causes an exception (I assume its
> illegal characters or something)
> 
> http://192.168.0.6:8081/video/clip_art/pan's.labyrinth[2006]dvdrip[eng.sub]-axxo+new.+swesub.+prien.avi.jpg
> 
> 
> and this does not
> http://192.168.0.6:8081/Audio/Album+Art/P-T/Therion_Sirius+B.jpg
> 
> when used here:
> 
> InputStream content = (InputStream) url.getContent();
> 

It should be encoded with java.net.URLEncoder. There are characters in
that string which are not "safe" within a URL.


From RFC 1738:
> Unsafe:
> 
>    Characters can be unsafe for a number of reasons.  The space
>    character is unsafe because significant spaces may disappear and
>    insignificant spaces may be introduced when URLs are transcribed or
>    typeset or subjected to the treatment of word-processing programs.
>    The characters "<" and ">" are unsafe because they are used as the
>    delimiters around URLs in free text; the quote mark (""") is used to
>    delimit URLs in some systems.  The character "#" is unsafe and should
>    always be encoded because it is used in World Wide Web and in other
>    systems to delimit a URL from a fragment/anchor identifier that might
>    follow it.  The character "%" is unsafe because it is used for
>    encodings of other characters.  Other characters are unsafe because
>    gateways and other transport agents are known to sometimes modify
>    such characters. These characters are "{", "}", "|", "\", "^", "~",
>    "[", "]", and "`".
> 
>    All unsafe characters must always be encoded within a URL. For
>    example, the character "#" must be encoded within URLs even in
>    systems that do not normally deal with fragment or anchor
>    identifiers, so that if the URL is copied into another system that
>    does use them, it will not be necessary to change the URL encoding.
> 
> 

-- 
Nigel Wade

Back to comp.lang.java.programmer | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

Android: create drawable from path Dirk Bruere at NeoPax <dirk.bruere@gmail.com> - 2011-04-14 18:37 +0100
  Re: Android: create drawable from path Lew <lew@lewscanon.com> - 2011-04-14 12:06 -0700
    Re: Android: create drawable from path Dirk Bruere at NeoPax <dirk.bruere@gmail.com> - 2011-04-14 21:32 +0100
      Re: Android: create drawable from path Lew <noone@lewscanon.com> - 2011-04-14 18:32 -0400
        Re: Android: create drawable from path Dirk Bruere at NeoPax <dirk.bruere@gmail.com> - 2011-04-15 00:52 +0100
          Re: Android: create drawable from path Patricia Shanahan <pats@acm.org> - 2011-04-14 17:28 -0700
            Re: Android: create drawable from path Dirk Bruere at NeoPax <dirk.bruere@gmail.com> - 2011-04-15 02:20 +0100
              Re: Android: create drawable from path Patricia Shanahan <pats@acm.org> - 2011-04-14 21:20 -0700
                Re: Android: create drawable from path Dirk Bruere at NeoPax <dirk.bruere@gmail.com> - 2011-04-15 11:38 +0100
                Re: Android: create drawable from path Patricia Shanahan <pats@acm.org> - 2011-04-15 09:25 -0700
                Re: Android: create drawable from path Dirk Bruere at NeoPax <dirk.bruere@gmail.com> - 2011-05-04 18:29 +0100
                Re: Android: create drawable from path markspace <-@.> - 2011-05-04 11:24 -0700
                Re: Android: create drawable from path Daniele Futtorovic <da.futt.news@laposte-dot-net.invalid> - 2011-05-04 20:27 +0200
                Re: Android: create drawable from path Nigel Wade <nmw-news@ion.le.ac.uk> - 2011-05-05 09:39 +0100
          Re: Android: create drawable from path Lew <noone@lewscanon.com> - 2011-04-15 07:27 -0400

csiph-web