[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Uri.escape default

Han Holl

11/26/2004 1:24:00 PM


Hi,

URI::UNSAFE is the default for url-encoding.
It's value is: /[^-_.!~*'()a-zA-Z\d;\/?:@&=+$,\[\]]/n

In the light of the following:

For worldwide interoperability, URIs have to be encoded uniformly. To map the
wide range of characters used worldwide into the 60 or so allowed characters
in a URI, a two-step process is used:

* Convert the character string into a sequence of bytes using the UTF-8
encoding
* Convert each byte that is not an ASCII letter or digit to %HH, where HH
is the hexadecimal value of the byte

(source: http://www.w3.org/International/O-URL...)

I would expect something like /[^A-Za-z0-9]/ with maybe some obvious allowed
characters like . included.

Cheers,

Han Holl