Why clipboard of url is encoded? [duplicate] - url

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about programming within the scope defined in the help center.
Closed last year.
The community reviewed whether to reopen this question last year and left it closed:
Original close reason(s) were not resolved
Improve this question
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)

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.

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.

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

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.

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

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

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

You can use Chrome and FireFox extension called "Copy Unicode URLs", which I created.
It is:
Open source.
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.

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

Related

What is si=a or si=fc, etc in my soundcloud link? [duplicate]

https://www.airbnb.com/help?audience=host?audience=guest?audience=host?audience=host?audience=host
The URL above was created occasionally by me.
A normal URL to me has one question mark while all parameters are distinct. So in my opinion, this URL is abnormal.
What seems weird to me is that it still works and my browser has no complaint about it.
Would anyone explain it to me?
The first ? indicates the query component. The query component is terminated by the first following #, or the end of the URL.
So, this is the query component of your URL:
audience=host?audience=guest?audience=host?audience=host?audience=host
Within the query component, it’s perfectly fine to use ? characters, they don’t have any special meaning there (list of all allowed characters in the query).
While parameters in the query typically are in the name=value format, separated by &, this is just a convention (it’s what the encoding type application/x-www-form-urlencoded in HTML forms produces). Site authors can use whatever format they want.

Why does %20 become %2520 when I use a redirected url?

This works as expected - it returns one record:
https://terraref.ncsa.illinois.edu/bety/api/v1/search.json?sitename=~Season%204&limit=1
this does not
when I use the base url terraref.org rather than terraref.ncsa.illinois.edu:
https://terraref.org/bety/api/v1/search.json?sitename=~Season%204&limit=1
because in this second case the % is replaced by %25 and the query term is then not found.
Questions
How can I fix it?
Why has this appeared in the last few months and
Update
you can see question history for the red herring related to the R packages I was using
thanks to the comments, I've narrowed down the issue, I think
I've included tags ruby-on-rails and nginx because these are the tools that the api and server are using.
Somehow, you are encoding the value for sitename 2 times. In this example the decoded value is Season 4 when you encode first time Season%204and doing it the second time %20Season%25204.
Investigate the code to verify whether value for sitename already encoded and you doing it again.
Check Chrome DevTools to debug the problem.
Your call is being redirected with the following query parameters.
sitename: ~Season 4
limit: 1
If you choose the encoded view, you'll see the culprit.
So, as one might expect, it's just as simple as double url encoding.
If you need to use terraref.org as a base url, replace space with a plus.
https://terraref.org/bety/api/v1/search.json?sitename=~Season+4&limit=1

Inexplicable behavior when copying URL from Firefox address bar

Can someone explain to me the following behavior:
When I copy a specific URL from Firefox and paste it to Notepad++ (or Stack Overlow) some parameters changed. I can't post the orginial URL but it's something like this:
In address bar:
https://xxx.xxx-xxxx.de/xxxxx//xxxxx?project=xxxxl&query=xxxx&keyname=OBJNAME&keyvalue=05-(G)28-01-008
But Notepad++ and Stack Overflow shows me this:
https://xxx.xxx-xxxx.de/xxxxx//xxxxx?project=xxxx&query=xxxxx&keyname=OBJNAME&keyvalue=05%2D%28G%2928%2D01%2D008
This URI is percent-encoded.
See the URI standard: Percent-Encoding. There are various reasons why something could be percent-encoded (sometimes it’s required, sometimes optional; sometimes it changes the meaning, sometimes not).
Some browsers display the URL after decoding the percent-encoded parts. This is typically done for usability reasons: it’s nicer to see https://en.wikipedia.org/wiki/Ö instead of https://en.wikipedia.org/wiki/%C3%96.
Copy-pasting the URL from the address bar to some other place is one way to see the actual URL (with percent-encoding).

W3C validator says 'feed does not validate' 'url must be a full URL'... whats wrong with it?

Validating my feed, it has an enclosure with a URL of
https://archive.org/download/NigelFarageAPersonalMessageToNorthernIrelandVoters./Nigel%20Farage,%20a%20personal%20message%20to%20Northern%20Ireland%20voters..mp3
I know it is a bit convoluted... but what is wrong with it? The stop in the directory name? the double dot in the file name? the comma? all of em?
I have looked at the RFC on URL's but cant make it out(!).
This feed does not validate.
line 441, column 2: url must be a full URL: https://archive.org/download/NigelFarageAPersonalMessageToNorthernIrelandVoters./Nigel%20Farage,%20a%20personal%20message%20to%20Northern%20Ireland%20voters..mp3 (4 occurrences) [help]
<enclosure type="audio/mpeg" url="https://archive.org/download/NigelFarage ...
^
** edit **
A useful (even if incorrect) answer was added (and removed...) showing the result from the w3c URL validator - https://validator.w3.org/checklink
This Link Checker looks for issues in links, anchors and referenced objects in a Web page, CSS style sheet, or recursively on a whole Web site. For best results, it is recommended to first ensure that the documents checked use Valid (X)HTML Markup and CSS. The Link Checker is part of the W3C's validators and Quality Web tools.
If you find this question, you may find the link checker a useful resource!
The problem seems to be that it’s a HTTPS URL instead of a HTTP URL.
The linked error documentation, foo attribute of bar must be a full URL, says:
If this is a link to a web page, you must include the "http://" at the beginning and immediately follow it with a valid domain name.
The RSS 2.0 spec says about <enclosure>:
The url must be an http url.
If you change https://archive.org/download/… to http://archive.org/download/…, it validates.
And if you don't have httpS then your SSL says your page isn't secure. #feedvalidator step up. There are a ton of feedback/complaints about this on the support forum here https://groups.google.com/forum/#!forum/feedvalidator-users
More specifically here: https://github.com/rubys/feedvalidator/issues/16

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

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about programming within the scope defined in the help center.
Closed last year.
The community reviewed whether to reopen this question last year and left it closed:
Original close reason(s) were not resolved
Improve this question
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)
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.
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.
In Firefox 53+ you can set browser.urlbar.decodeURLsOnCopy about:config option to true.
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.
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
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=中文
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 :)
You can use Chrome and FireFox extension called "Copy Unicode URLs", which I created.
It is:
Open source.
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.
Copy addres without 'h' in http...
And past addres without 'h' and sum first addres with 'h'

Resources