Hi there Jesse,
Three questions then.
Did encodeURIComponent solve the problem or is it still causing trouble?
Are you using the XML encoding for sending the request from an HTTP
request? If you are using a standard HTTP request it does a url form
encoding on everything before it goes out I believe.
Are you using the built in Base64Encoder class or your own code? I've
heard of a non-documented built-in utility class for base64
encode/decoding. Just curious about what you were using.
Thanks,
Michael
Doug Lowder wrote:
Yes, that's it exactly and Adobe got it right. The + is listed as a
non-encoded character in the docs for encodeURI(). So what needs to
be done is call encodeURIComponent() on the substring, which *will*
encode the + since it isn't a non-encoded character for that
function, and then tack that onto an encodeURI()'d string.
--- In [email protected]
<mailto:flexcoders%40yahoogroups.com>, "Paul DeCoursey" <[EMAIL PROTECTED]> wrote:
>
> I think the problem is that the + should not be encoded. You must
> encode it before adding it to the URI. It is a reserved character
and
> it has special meaning in certain places in the URI. It should not
be
> encoded in those places. As a result I am speculating that an
encode
> function will not encode it. An example of a special meaning is
that
> it can be used in place of spaces in a URL, it is just as common to
> use %20 for a space, but a + is more readable.
>
> Paul
>
> --- In [email protected]
<mailto:flexcoders%40yahoogroups.com>, "Doug Lowder" <douglowder@>
wrote:
> >
> > How about encodeURIComponent("dude man+") ? The + character, as
well
> > as some others, is a reserved character in URIs.
> >
> > --- In [email protected]
<mailto:flexcoders%40yahoogroups.com>, "Jesse Warden" <jesse.warden@>
> > wrote:
> > >
> > > Weird... encodeURI does the same thing. Check it:
> > >
> > > var str:String = encodeURI("dude man+");
> > >
> > > Notice that with encode or encodeURI, you'll get:
> > >
> > > dude%20man+
> > >
> > > ...bleh! That dang + should be %2D instead.
> > >
> > > BTW, for background context, I'm first base64'ing some XML, and
then
> > > encoding it to send as a GET request param. If you know of a
better
> > > way, I'm all ears.
> > >
> > > On 4/24/07, Jesse Warden <jesse.warden@> wrote:
> > > > Nope. I'm using encode.
> > > >
> > > > On 4/24/07, Michael Wills <michael@> wrote:
> > > > >
> > > > >
> > > > >
> > > > >
> > > > >
> > > > >
> > > > > Are you using encodeURI? You may need to use
> > encodeURIComponent instead.
> > > > > Just checking briefly on the JS versions.
> > > > >
> > > > > Michael
> > > > >
> > > > > Jesse Warden wrote:
> > > > >
> > > > >
> > > > >
> > > > > Running encode on a String seems to be missing the +. For
> > example, a
> > > > > space " " becomes %20 like expected. But, a + is not
becoming %
> > 2D...
> > > > > anyone know why?
> > > > >
> > > > >
> > > > >
> > > >
> > >
> >
>