Copying a UTF-8 URL from browser's address bar

2019-03-08 02:02发布

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)

5条回答
够拽才男人
2楼-- · 2019-03-08 02:14

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.

查看更多
再贱就再见
3楼-- · 2019-03-08 02:22

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.

查看更多
Luminary・发光体
4楼-- · 2019-03-08 02:23

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

查看更多
聊天终结者
5楼-- · 2019-03-08 02:28

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

查看更多
神经病院院长
6楼-- · 2019-03-08 02:34
登录 后发表回答