Cross-Platform C++

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.




Method Summary
static String Encode(const String& s)
         Converts a Unicode string into the MIME x-www-form-urlencoded format.
static ByteString EncodeBytes(const ByteString& in)
         Encodes a sequence of Bytes into the MIME x-www-form-urlencoded format, which is described in the HTML 4.0 Recommendation.
static String RawEncode(const String& s)
         Converts a Unicode string into an escaped form.

Method Detail

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:


EncodeBytes

static ByteString EncodeBytes(const ByteString& in)
Encodes a sequence of Bytes into the MIME x-www-form-urlencoded format, which is described in the HTML 4.0 Recommendation. Each byte in the passed sequence is examined and added to the returned ByteString after going through the following transformation:-

Returns:
A ByteString containing the encoded bytes.
Since:
OpenTop 1.5

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.



Cross-Platform C++

Found a bug or missing feature? Please email us at support@elcel.com

Copyright © 2000-2005 ElCel Technology   Trademark Acknowledgements