Viewing last 25 versions of post by Background Pony #699F in topic Ask the Mods Important Site Questions (V2)

Background Pony #699F
[What the fuck, Github: "Code search now requires login"](https://github.blog/changelog/2023-06-07-code-search-now-requires-login/)

---

Not a mod, but can help:

[@OneMoreAnonymous](/forums/meta/topics/ask-the-mods-important-questions-v2?post_id=5470311#post_5470311)
The list of character-to-string substitutions is in [slug.ex](https://github.com/philomena-dev/philomena/blob/master/lib/philomena/slug.ex). They are [then encoded](https://github.com/philomena-dev/philomena/blob/54e775a6c6bf3d40b469ed91a167ccdf8c27f7f7/lib/philomena_web/views/tag_view.ex#L23) with [Elixir's URI encode function](https://hexdocs.pm/elixir/URI.html#encode/2) which I do not know the specifics about how it works, but one time when I tried to replicate Derpibooru's tag encoding, I ended up with `encodeURIComponent(str).replace(/[!'()*]/g, c => '%' + c.charCodeAt(0).toString(16))` in JavaScript (taken from Stack Overflow)

Note that browsers may perform a silent conversion between the encoded form and the human-readable display of characters: for example, for me in Chrome, accessing your second link displays the Chinese characters in the URL bar, but the network tab of the developer tools reveals that a request was made to `/tags/artist-colon-%E7%94%B0%E5%9B%AD%E9%94%84%E4%B8%B2%E5%AD%90`

However, [there is a wrinkle which I believe makes it impossible to programmatically figenderate a tag's URL](/forums/meta/topics/site-development-notification-and-feedback-thread?post_id=5335201#post_5335201): tags first used before [this patch in 2020](https://github.com/philomena-dev/philomena/commit/54e775a6c6bf3d40b469ed91a167ccdf8c27f7f7) were double-encoded, and won't work if single-encoded, with no way to know which way a tag is without either just looking it up through the API (eg. [artist:未知的生物](/api/v1/json/search/tags?q=artist:未知的生物), [artist:田园锄串子](/api/v1/json/search/tags?q=artist:田园锄串子)) or to cache a list of all affected legacy tags, which I have done but is 56 times too many characters to post in the forums.
No reason given
Edited by Background Pony #699F