I am working on a browser plugin that takes the URL of the current page or any selected link as a parameter and sends it to our server. When the main Latin alphabet characters are present in the URL (for example, http://en.wikipedia.org/wiki/Vehicle ), the plugin works fine. However, when the URL contains characters from another alphabet, such as http://ru.wikipedia.org/wiki/Stroller , the plugin does not work, I use the method encodeURIComponent, but this does not seem to solve the problem. Any idea?
encodeURIComponent
Thank,
Olivie.
, encodeURI/decodeURI, URI , ASCII, . URI, : /, , ; -ASCII , URI. , , , , URI <a href="..."> ( ).
encodeURI
decodeURI
:
/
<a href="...">
encodeURIComponent URI, , URI, URI.
, UTF-8. http://www.webtoolkit.info/javascript-url-decode-encode.html.
Source: https://habr.com/ru/post/1764753/More articles:Delaying execution with setTimeout - javascriptInternationalizing .NET Applications - .netMultiple word lists in csh script foreach loop - shellНеобходимы рекомендации по интеграции с MediaWiki/Python - pythonDoes Spring (3) have native pagination support? - javaDefining a strategy for splitting book lists without SQL - javaCan I display a form on top of or next to the Windows Vista login screen? - c #How can I write in scientific notation using Perl formats? - formatRefresh controller controller contents in foreground app - iphoneAppFabric Cache Cluster SCM Management - cachingAll Articles