ot::net
class URLEncoder
#include "ot/net/URLEncoder.h"
A class module containing static methods for encoding strings into a form that can be transmitted as a URL.
Encode
static String Encode(const String& s)
-
Converts a Unicode string into the MIME x-www-form-urlencoded format.
To convert a String, each Unicode character is examined in turn:
-
The ASCII characters 'a' through 'z', 'A' through 'Z', '0' through '9', and ".", "-", "*", "_" remain the same.
-
The space character ' '(U+20) is converted into a plus sign '+'.
-
All other characters are converted into their UTF-8 equivalent and the subsequent bytes are encoded as the 3-byte string "xy", where xy is the two-digit hexadecimal representation of the byte.
RawEncode
static String RawEncode(const String& s)
-
Converts a Unicode string into an escaped form.
This method performs a similar function to Encode(), but the algorithm has been modified to ignore certain escape characters thereby making it idempotent.
The algorithm employed is described in the W3C XML recommendation section 4.2.2, External Entities.
Found a bug or missing feature? Please email us at support@elcel.com