By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
432,385 Members | 847 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 432,385 IT Pros & Developers. It's quick & easy.

urlencode(addslashes(chr(0)))

P: n/a
Any ideas as to why urlencode(addslashes(chr(0))) returns '%5C0'? It
seems like it should return '%00' since that's what urlencode(chr(0))
returns. If not that, I could also see it returning '%5C%00' since
that's what urlencode('\\').urlencode(chr(0)) and
urlencode('\\'.chr(0)) return. '%5C0', however, confuses me. Even
urlencode(chr(0x5C0)) doesn't return '%5C0' - it returns '%C0'.

Oct 23 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
>Any ideas as to why urlencode(addslashes(chr(0))) returns '%5C0'? It

addslashes(chr(0)) should return '\0'.
seems like it should return '%00' since that's what urlencode(chr(0))
returns. If not that, I could also see it returning '%5C%00' since
that's what urlencode('\\').urlencode(chr(0)) and
urlencode('\\'.chr(0)) return. '%5C0', however, confuses me. Even
urlencode(chr(0x5C0)) doesn't return '%5C0' - it returns '%C0'.


urlencode '\0' and the backslash turns into %5C, and the 0 is unchanged.
Therefore, %5C0.

Gordon L. Burditt
Oct 23 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.