Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Hex codes in links

by jo37 (Pilgrim)
on Jun 21, 2020 at 14:02 UTC ( #11118311=monkdiscuss: print w/replies, xml ) Need Help??

The node 11118252 has a "special" link that contains a vertical bar (encoded as %7C). This link has been constructed by specifying the full href, as choroba told me in a private message. As the vertical bar cannot be used directly in a link at the monastery as it separates the location from the displayed text, it must be encoded in some way. Trying to use the path IO::Uncompress::Gunzip#Transparent-=>-0%7C1 with some shortcut schemas gives interesting results:

[metamod://IO::Uncompress::Gunzip#Transparent-=>-0%7C1] -> https://metacpan.org/pod/IO%3A%3AUncompress%3A%3AGunzip%23Transparent-%3D%3E-0%257C1
points to nowhere (404)

[doc://IO::Uncompress::Gunzip#Transparent-=>-0%7C1] -> http://perldoc.perl.org/IO/Uncompress/Gunzip.html#Transparent-%3D%3E-0%257C1
links to the page, but not to the specified section

[mod://IO::Uncompress::Gunzip#Transparent-=>-0%7C1] -> http://search.cpan.org/perldoc?IO%3A%3AUncompress%3A%3AGunzip%23Transparent-%3D%3E-0%257C1
links to the specified section

<EDIT> metacpan.org and search.cpan.org work just fine, when accessed with the original path component "as is". The perdoc.perl.org example is misleading, as there are no anchors within the page. </EDIT>

All the generated links (except the full href) have one thing in common: The percent sign becomes encoded as %25. It depends on the target side if this will be interpreted in a useful way. I didn't find any documentation on how to include a hex encoded value in a link. Obviously it is handled different in a full href. Is this a bug or is it a feature? If it's a feature, then another feature might be missing: including hex codes in a path.

Greetings,
-jo

$gryYup$d0ylprbpriprrYpkJl2xyl~rzg??P~5lp2hyl0p$

Replies are listed 'Best First'.
Re: Hex codes in links
by Anonymous Monk on Jun 21, 2020 at 17:31 UTC
    Linking shortcuts are for monkeys to type. Anchors were never portable between different targets. If you want anchors copy url from browser bar after clicking

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: monkdiscuss [id://11118311]
Approved by hippo
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (3)
As of 2020-09-19 00:00 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    If at first I donít succeed, I Ö










    Results (113 votes). Check out past polls.

    Notices?