Static Public Member Functions
Osp::Base::Utility::UrlEncoder Class Reference

Since:
2.0

The UrlEncoder class provides a method for encoding a string using a specific encoding scheme.

For more information on the class features, see UrlEncoder and UrlDecoder.

The following example demonstrates how to use the UrlEncoder class.

    // includes
    #include <FBase.h>

    // namespace
    using namespace Osp::Base;
    using namespace Osp::Base::Utility;

    void
    MyClass::UrlEncoderSample(void)
    {
        result r = E_SUCCESS;
        String str1(L"url encoding test?");
        String str2;

        // Encode the input string.
        r = UrlEncoder::Encode(str1, L"UTF-8", str2);

    }

List of all members.

Static Public Member Functions

static result Encode (const Osp::Base::String &str, const Osp::Base::String &encodingScheme, Osp::Base::String &encodedStr)

Member Function Documentation

static result Osp::Base::Utility::UrlEncoder::Encode ( const Osp::Base::String str,
const Osp::Base::String encodingScheme,
Osp::Base::String encodedStr 
) [static]

Encodes an input string using a specific encoding scheme.
It encodes all unsafe characters of a string.

Since:
2.0
Returns:
An error code
Parameters:
[in]strAn instance of String to be encoded
[in]encodingSchemeThe supported encoding scheme
[out]encodedStrThe encoded string
Exceptions:
E_SUCCESSThe method is successful.
E_INVALID_ARGA specified input parameter is invalid.
E_OUT_OF_MEMORYThe memory is insufficient.
E_SYSTEMA system error has occurred.
E_UNSUPPORTED_TYPEThe specified encoding scheme is not supported.
E_INVALID_ENCODING_RANGEThe specified string contains code points that are outside the bounds of the character encoding scheme.
Remarks:
This method is used for encoding. It encodes input string into an application/x-www-form-urlencoded format using a specific encoding scheme. This method uses the specified encoding scheme to obtain the bytes for unsafe characters.
See also:
UrlDecoder

The documentation for this class was generated from the following file:

Copyright © 2011 Samsung Electronics Co., Ltd. All rights reserved.