89

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)

AbdelHady
  • 9,334
  • 8
  • 56
  • 83
  • 3
    Another good solution see at http://superuser.com/questions/480692/copying-unicode-symbols-from-firefox-address-bar-as-is#answers. – Hans Ginzel Nov 10 '16 at 16:34
  • @HansGinzel looks promising, the issue is that that question is Firefox related only, while some answers here are more generic, thanks – AbdelHady Nov 10 '16 at 19:03
  • 2
    I voted to close this question because it is not a programming question. Rather, it is about using a web browser. – Stephen Ostermiller Feb 15 '22 at 11:23

9 Answers9

102

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.

Mir-Ismaili
  • 13,974
  • 8
  • 82
  • 100
mementototem
  • 1,228
  • 1
  • 11
  • 9
62

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.

DanSkeel
  • 3,853
  • 35
  • 54
  • I didn't know it could work :) , just one problem with it, usually `http://` isn't visible so if the domain doesn't start with a subdomain (i.e `www.`) like the example in the question, then I won't be able to copy only part of it, is there a workaround for it? – AbdelHady Feb 09 '15 at 15:31
  • 3
    Copy everything except first character and than add it manually. – DanSkeel Feb 09 '15 at 22:26
  • The only working solution, nice trick, thanks! – Sunding Wei Sep 02 '22 at 03:45
12

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

int_ua
  • 1,646
  • 2
  • 18
  • 32
  • 2
    Woow, Firefox can do that ! :) .. if it weren't a Firefox-only answer, I would have accepted it right now .. I know it might look risky sometimes, but the option itself looks awesome, thanks. – AbdelHady May 13 '20 at 11:48
  • Well, it's not a full answer to the main question which is not only about Firefox. Also, Firefox on Android doesn't have this feature sadly, it's only about desktop: https://android.stackexchange.com/q/224951/17612 – int_ua May 13 '20 at 12:45
7

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.

AbdelHady
  • 9,334
  • 8
  • 56
  • 83
Julien Palard
  • 8,736
  • 2
  • 37
  • 44
  • 7
    you are talking mostly about the naming here, but I just wanted a readable form of the URL to be shared with others easily, & the chrome extension I used in my answer is doing exactly what I wanted – AbdelHady Sep 16 '14 at 14:11
  • 2
    He is not talking about naming but about standards, which is a huge difference. Even if the answer does not solve the asker's problem, it still contains critical information and I am glad it's here. Still, most people use browsers to do work with links, and for most browsers IRI and URIs are functionally the same, I suppose. – Morgus Lethe Dec 13 '20 at 09:58
  • There's a difference between machine-usable and human-readable strings: The URI is a machine-usable string but OP seems to me looking for a human-readable string. When storing or referencing URLs you normally want a human-readable form because %XX%XX%XX%XX%XX isn't useful to any human and can't be proofread. Chrome understands IRIs so if the intention is for a human to see the string or for the string to be fed back to Chrome by a human then the human-readable one is preferred. URIs are better suited for passing information between programs when a human is not involved. – V13 Apr 10 '23 at 15:17
7

You can use Chrome Extensions like below:

https://chrome.google.com/webstore/detail/copy-unicode-urls/fnbbfiapefhkicjhecnoepbijhanpkjp

https://chrome.google.com/webstore/detail/copy-cyrilic-urls/alnknpnpinldhpkjkgobkalmoaeolhnf

ronnefeldt
  • 2,083
  • 23
  • 24
  • 20 May 2020 - It works on latest chrome. Thanks Ilya – alitrun May 19 '20 at 22:24
  • @ronnefeldt, could you, please, delete/hide/edit this answer since the link in it doesn't work any more and returns 404. – ilyaigpetrov Oct 27 '20 at 09:02
  • @ronnefeldt, could you, please, instead of using a direct link to "Copy Unicode URLs" changed it to a link to my answer below in this thread. I would be glad to have some upvotes for an extension which I created. It's not very important to me, I just like upvotes. Thank you. – ilyaigpetrov Oct 29 '20 at 10:22
7

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=中文

dvorak4tzx
  • 493
  • 7
  • 8
5

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 :)

AbdelHady
  • 9,334
  • 8
  • 56
  • 83
4

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.

ilyaigpetrov
  • 3,657
  • 3
  • 30
  • 46
2

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