Uri Encoding Implementation

Hello everyone,

I need help answering a more in-depth technical question:
What exactly is the implementation or standart for the $tc(url, )$ formula? Based on the fact that " " is encoded to “+” and the other percent encoding, it seems to be application/x-www-form-urlencoded. But it could also be a custom implementation… Can someone clarify that?

Hi there,

As far as I know, the tc(url) function takes 2 parameters by default:

  • 1st parameter: url
  • 2nd parameter: the string

By default, the function will encode the string using the UTF-8 encoding method, but we can add a 3rd parameter for other encoding methods, such as: ASCII, UTF-16, or UTF-32 .

Example, to encode the string using UTF-16:
$tc(url, "the original string, like URL-address.", "UTF-16")$

This screenshot shows the description of the tc(url) function indicates the UTF-8 encoding method is used.

Perhaps someone else here knows better.

I hope this would help.
:smiling_face::+1:

Thank you for your help.
I just tested all ascii characters and the only whitelisted characters are *, -, _ and .. is converted to +. [A-Za-z0-9] is left unchanged. Everything else is converted into the UTF-8 (or the specified codepage) byte representation (%XX).
That rules work for my cross-platform needs.