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

后端 未结 8 494
清酒与你
清酒与你 2020-12-12 15:33

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 exa

相关标签:
8条回答
  • 2020-12-12 16:03

    You can use Chrome 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.

    0 讨论(0)
  • 2020-12-12 16:07

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

    0 讨论(0)
  • 2020-12-12 16:10

    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.

    0 讨论(0)
  • 2020-12-12 16:12

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

    Click this bookmark on that page.

    0 讨论(0)
  • 2020-12-12 16:16

    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.

    0 讨论(0)
  • 2020-12-12 16:20

    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

    0 讨论(0)
提交回复
热议问题