Change-Id: I9c76f09bdb4a0fdb2cb471b2a3c8125ac65f2c86
Signed-off-by: min7.choi <min7.choi@samsung.com>
#include <string.h>
#include <stdlib.h>
#include "glib.h"
#include <string.h>
#include <stdlib.h>
#include "glib.h"
#include "download-agent-debug.h"
#include "download-agent-encoding.h"
#include "download-agent-debug.h"
#include "download-agent-encoding.h"
void decode_url_encoded_str(const char *in_encoded_str, char **out_str)
{
void decode_url_encoded_str(const char *in_encoded_str, char **out_str)
{
- char *in = NULL;
- char *out = NULL;
- *out_str = calloc(1, strlen(in_encoded_str) + 1);
- if (*out_str == NULL)
+ CURL* curl = curl_easy_init();
+
+ *out_str = curl_easy_unescape(curl, in_encoded_str, strlen(in_encoded_str), NULL);
+
+ if(!*out_str){
+ DA_LOGE("CURLE_OUT_OF_MEMORY");
- out = *out_str;
- in = (char *)in_encoded_str;
- while (*in)
- {
- if (*in == '%') {
- int hex = 0;
- in++;
- if (sscanf(in, "%2x", &hex) <= 0) {
- return;
- } else {
- *out = hex;
- in++;
- }
- } else if (*in == '+') {
- *out = ' ';
- } else {
- *out = *in;
- }
- in++;
- out++;
+
+ curl_easy_cleanup(curl);
%define _ux_define tizen2.3
Name: download-provider
Summary: Download the contents in background
%define _ux_define tizen2.3
Name: download-provider
Summary: Download the contents in background
Release: 0
Group: Development/Libraries
License: Apache-2.0
Release: 0
Group: Development/Libraries
License: Apache-2.0