diff --git a/AK/URL.h b/AK/URL.h index 96f96eb51b..3f6b965415 100644 --- a/AK/URL.h +++ b/AK/URL.h @@ -28,6 +28,7 @@ #include #include +#include namespace AK { @@ -63,6 +64,11 @@ public: String basename() const; String to_string() const; + String to_string_encoded() const + { + // Exclusion character set is the same JS's encodeURI() uses + return urlencode(to_string(), "#$&+,/:;=?@"); + } URL complete_url(const String&) const;