I have a form using the GET method. If values are submitted with special characters, they appear in 开发者_StackOverflow社区the URI as: ?value=fudge%20and%20stuff
How do I make it clean? I don't want to use the header function because this is happening within a page in drupal.
A URL cannot contain spaces and many other "special characters", therefore they get encoded. Unfortunately there isn't a lot you can do about it. The most you could do is some JavaScript trickery in the form, but I don't think it's worth it.
If %20
bothers you, you can substitute (GREP replace) the + character (?value=fudge+and+stuff
) for better readability. Otherwise there's not a lot you can do. Other "exotic" characters will be similarly escaped, and need to be.
URL :?value=fudge%20and%20stuff
Encoded as: fulg< space >
and < space >stuff
精彩评论