If you copy the link below into the browser
http://be.wikipedia.org/wiki/Беларусь
it will show the Wiki article. But once you want to copy th
I guess encodeURI(string)
should be what you are looking for. Just check out already existing answers to the same question e.g. here!
The function you're searching for is encodeURIComponent
.
encodeURIComponent("Беларусь");
// returns "%D0%91%D0%B5%D0%BB%D0%B0%D1%80%D1%83%D1%81%D1%8C"
Its counterpart is decodeURIComponent
which reverses this process.
decodeURIComponent("%D0%91%D0%B5%D0%BB%D0%B0%D1%80%D1%83%D1%81%D1%8C");
// returns "Беларусь"