Copying a UTF-8 URL from browser's address bar, gives only the ugly encoded one

UrlBrowserCopy PasteUrl Encoding

Url Problem Overview


When I copy a UTF-8 URL from the browser's address bar (almost any browser on any os), then try to paste it in another text field (to post it on facebook or twitter for example), it gives only the decoded URL, which makes it ugly. For example, in the address bar, the URL appears like this one:

> https://www.chaino.com/وذكر

But when trying to copy and paste it in any other place, it gives the following ugly url:

> https://www.chaino.com/%D9%88%D8%B0%D9%83%D8%B1

& if I wanted to get the original URL to use it in any place, I used to decode it in this Raw URL Decoder - Online Tool

Question is: is there a short direct way to copy these kind of URLs, and paste it without this hideous process? (may be using chrome extensions or something)

Url Solutions


Solution 1 - Url

You can add a 'space' at the end of the URL in the address bar, then you can select it all and copy it directly.

Solution 2 - Url

You can select URL without selecting scheme (e.g. http://), and copy it. This will give you what you expected.

P.S. The point is to select only part of the link. E.g. you can select whole URL without first character and than add it manually.

Solution 3 - Url

In Firefox 53+ you can set browser.urlbar.decodeURLsOnCopy about:config option to true.

Solution 4 - Url

The URI you get by copying from the address bar is the only valid URI the browser can give you.

From the RFC 3986 (and other URL RFCs):

> A URI is a sequence of characters from a very limited set: the > letters of the basic Latin alphabet, digits, and a few special > characters.

So: https://www.chaino.com/وذكر Is an invalid URI, yet a valid IRI (International Resource Identifier), that your browser will convert to a valid URI while requesting the server over HTTP (HTTP does not allow IRI, only URI).

TL;DR: Your browser is giving you what you expect: A valid URI that you can use everywhere, not an IRI only supported here and here.

PS If "facebook or twitter for example" are kind, they may display a readable form to their users, so don't worry about giving an encoded form.

Solution 5 - Url

Solution 6 - Url

The best answer I found tell now is using this Chrome extension: https://chrome.google.com/webstore/detail/copy-cyrilic-urls/alnknpnpinldhpkjkgobkalmoaeolhnf?hl=en-US

which enables me to copy the url (in a decoded state) with only one click :)

Solution 7 - Url

Create a bookmark with this url: javascript:console.log(prompt('copy (Control+C) this link:', decodeURIComponent(window.location))).

Click this bookmark on that page.

Example page: <https://www.google.com.hk/search?q=中文>

Solution 8 - Url

You can use Chrome and FireFox extension called "Copy Unicode URLs", which I created. It is:

  1. Open source.
  2. Gives you an option to leave URL terminators encoded so, e.g., links that end with a dot will have that dot encoded and email clients won't wrongly recognize this dot as a sentence/URL terminator.

If you love my work then, please, donate some sum here.

Solution 9 - Url

Copy addres without 'h' in http... And past addres without 'h' and sum first addres with 'h'

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionAbdelHadyView Question on Stackoverflow
Solution 1 - UrlmementototemView Answer on Stackoverflow
Solution 2 - UrlDanSkeelView Answer on Stackoverflow
Solution 3 - Urlint_uaView Answer on Stackoverflow
Solution 4 - UrlJulien PalardView Answer on Stackoverflow
Solution 5 - UrlronnefeldtView Answer on Stackoverflow
Solution 6 - UrlAbdelHadyView Answer on Stackoverflow
Solution 7 - Urldvorak4tzxView Answer on Stackoverflow
Solution 8 - UrlilyaigpetrovView Answer on Stackoverflow
Solution 9 - UrlAfshin EstarabadiView Answer on Stackoverflow