Url forward slash encoded in small letter case instead capital letter 2f instead 2F

I am having an issue with some services not recognising that two pages are the same but handing in 2f instead of 2F (and same with : that goes 2e instead of 2E). Is there a way to change this encoding behaviour? It happens in every encdoding. I tried disablePathToLower: false but it is now working (and I don’t believe it is a good practice anyways).
This is happening in particluar when I use data-href=“{{ .Permalink }}” but also in other ways.
Thank you for the response.

“some services” … can you explain it :wink:

2F / 2F is the slash “/” and not a part of a directory or file name.

sometimes the function safeURL can help

data-href="{{ .Permalink | safeURL}}"

Greetings. It might be a Facebook problem. In anycase let me be more explicit. I had a website that used Facebook Links to share. [Share Button - Social Plugins - Documentation - Facebook for Developers].
At least in that one, the share link created appears with capital letters. This the example from the Facebook website. You can see that the characters appear in capital letters. 2F and 3A.

When I use … target="_blank" href="Redirecting...{{ .Permalink }}
it creates 2f and 3a using lower case. SafeURL removes the these characters.

The problem arises, that the shares created with the original link with the 2F and 3A from the older website, appear with the amount of shares. But using safeURL, or lower case, the acounter appears to zero. I tried to write both (hard coded -manually entering the button with the address in the template single.html, followed with the one with the .Permalink or with the .Permalink | safeURL. It is not working.

The code I am talking about generated by Facebook is here (I cannot paste it becuase i have a limit of 2 links… but it is created in the Facebook Page I sent.

<div class="fb-share-button" ......

It might be a Facebook issue. In anycase, if I were able to encode those links with 2F and 3A instead of 2f and 3a, it will work.

Thank you. Ju in advance.

some Hugo functions could help, check it in the docs


more: replace, upper, etc …