Это отличается от кодирования см. Это очевидный конфликт, на который W3C указывает в течение многих лет. К сожалению, большинство пользовательских приложений не отправляют данные формы в формате с разделителем "точка с запятой". However, since 2005 the current RFC in use for URIs standard is RFC 3986. You must use rawurlencode for parts that гкд 100 4 инструкция before "? It took me some time not to find it. But findaly I decided to write my own code. Be careful when encoding strings that came from simplexml in PHP 5. If you try to urlencode a simplexml object, the script tanks. I got around the problem by using a cast. My solution is to replace "%" гкд 100 4 инструкция "'". This fixed it for me at least. Thomas I needed encoding and decoding for UTF8 urls, I came up with these very simple fuctions. Unless you're certain that you won't be encoding email addresses AND you need the readability provided by the non-standard "+" usage, instead always use use rawurlencode or rawurldecode. I'm running PHP version гкд 100 4 инструкция. This was a particular problem for me when trying to open local files with a " " in the filename as Firefox will interpret this as an anchor target for better or worse. Do not let the browser auto encode an invalid URL. Not all browsers perform the same encodeing. Keep it cross browser do it server side. I think this was mentioned earlier but it was confusing. But that fixed my problem. Ones like î and Ç were passed correctly and were in their raw form when I passed them through without гкд 100 4 инструкция filtering. Firefox, however, does something weirder: it will convert it to it's HTML entity. It will display properly, but only when you don't convert entities. Be careful with гкд 100 4 инструкция characters. So, just decode it once more in your PHP script to fully undo the double-encoding. A bit more complex but very practically. In fact, if you don't urlencode POST data Гкд 100 4 инструкция Internet Explorer may pop a "syntax error" dialog when you call XMLHttpRequest. Why do you replace all %27 through ' in the same string in that you replace all ' through %27? Lets say I have a string: Hello %27World%27. It's a nice day. I get: Hello Hello 'World'. It%27s a nice day. With other words that solution is pretty useless. Solution: Just replace ' through %27 when encoding Just replace %27 through ' when decoding. Diferrent from the above example you do not have to encode URLs in hrefs with this. It is stunning how many people make mistakes with this.