How to URL encode (percent encode) a string in Vala (GLib):

Uri.escape_string ("Hello, world!");

// Hello%2C%20world%21

To decode:

Uri.unescape_string ("Hello%2C%20world%21");

// Hello, World!

(Documenting it as it was not easy to find with a cursory web search.)

· · Web · 1 · 1 · 1
Sign in to participate in the conversation
Aral’s Mastodon

The social network of the future: No ads, no corporate surveillance, ethical design, and decentralization! Own your data with Mastodon!