Hello. Does all browsers (in "Chrome", however, work) will work the following code?

var xmlhttp = getXmlHttp(); xmlhttp.open("GET", '/форум/ветки?страница=4&jx=1', true); xmlhttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded'); xmlhttp.send(null); 

Thank you in advance.

    1 answer 1

    RFC 3986 prohibits the use of non- US-ASCII characters in a URI (i.e., only characters 0 - 127 allowed). But if you want to use Cyrillic in the URL, then it will be correct to bring such a URL to the correct ASCII format - replace each Cyrillic character with a percent sign with the hexadecimal code of this character (use the encodeURI or encodeURIComponent functions for this JavaScript).

    When such a request is executed (without URL encoding, with Cyrillic characters), the browser may itself transcode the URL into the correct format. Chrome, and any self-respecting browser does. But each browser can do it in different ways (a little research on the topic that confirms this: HTTP, RFC 3986, and browsers ). Therefore, if you want unambiguity and correct transfer of parameters in the URL with Cyrillic characters, perform the encoding manually:

     xmlhttp.open("GET", encodeURI('/форум/ветки?страница=4&jx=1'), true);