Click here to Skip to main content
15,893,668 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: URL encoding/decoding function for C++ Pin
Rajesh R Subramanian20-Aug-09 22:58
professionalRajesh R Subramanian20-Aug-09 22:58 
GeneralRe: URL encoding/decoding function for C++ Pin
sashoalm20-Aug-09 23:27
sashoalm20-Aug-09 23:27 
GeneralRe: URL encoding/decoding function for C++ Pin
Rajesh R Subramanian21-Aug-09 0:12
professionalRajesh R Subramanian21-Aug-09 0:12 
QuestionRe: URL encoding/decoding function for C++ Pin
David Crow21-Aug-09 3:18
David Crow21-Aug-09 3:18 
AnswerRe: URL encoding/decoding function for C++ Pin
Randor 21-Aug-09 3:59
professional Randor 21-Aug-09 3:59 
AnswerRe: URL encoding/decoding function for C++ Pin
sashoalm21-Aug-09 5:19
sashoalm21-Aug-09 5:19 
GeneralRe: URL encoding/decoding function for C++ Pin
David Crow21-Aug-09 6:00
David Crow21-Aug-09 6:00 
AnswerRe: URL encoding/decoding function for C++ Pin
Djalma R. dos Santos Filho7-Jan-10 3:29
Djalma R. dos Santos Filho7-Jan-10 3:29 
// I suggest the following:

std::string s2 = m_RealUrl;
std::replace(s2.begin(),s2.end(),'+',' '); // ascii 32 decodding
s2 = decode_percents( s2 );

// I found decode_percents function in Boost 1.41.0 Inspect Tool library

std::string decode_percents(std::string const& url_path)
{
std::string::size_type pos = 0, next;
std::string result;
result.reserve(url_path.length());

while((next = url_path.find('%', pos)) != std::string::npos)
{
result.append(url_path, pos, next - pos);
pos = next;
switch(url_path[pos]) {
case '%': {
if(url_path.length() - next < 3) return "";
char hex[3] = { url_path[next + 1], url_path[next + 2], '\0' };
char* end_ptr;
result += (char) std::strtol(hex, &end_ptr, 16);
if(*end_ptr) return "";
pos = next + 3;
break;
}
}
}

result.append(url_path, pos, url_path.length());
return result;
}

http://www.boost.org/doc/libs/1_41_0/tools/inspect/link_check.cpp[^]

Regards,
Djalma R. Santos Filho

QuestionMultiple Child Dialogs Pin
SutterA20-Aug-09 22:23
SutterA20-Aug-09 22:23 
AnswerRe: Multiple Child Dialogs Pin
KarstenK20-Aug-09 22:56
mveKarstenK20-Aug-09 22:56 
GeneralRe: Multiple Child Dialogs Pin
SutterA20-Aug-09 23:10
SutterA20-Aug-09 23:10 
GeneralRe: Multiple Child Dialogs Pin
KarstenK21-Aug-09 0:34
mveKarstenK21-Aug-09 0:34 
GeneralRe: Multiple Child Dialogs Pin
SutterA21-Aug-09 2:50
SutterA21-Aug-09 2:50 
GeneralRe: Multiple Child Dialogs Pin
KarstenK21-Aug-09 2:56
mveKarstenK21-Aug-09 2:56 
GeneralRe: Multiple Child Dialogs Pin
SutterA21-Aug-09 3:05
SutterA21-Aug-09 3:05 
GeneralRe: Multiple Child Dialogs Pin
KarstenK21-Aug-09 3:10
mveKarstenK21-Aug-09 3:10 
AnswerRe: Multiple Child Dialogs Pin
SutterA21-Aug-09 3:16
SutterA21-Aug-09 3:16 
GeneralRe: Multiple Child Dialogs Pin
David Crow21-Aug-09 3:21
David Crow21-Aug-09 3:21 
AnswerRe: Multiple Child Dialogs Pin
Code-o-mat20-Aug-09 22:57
Code-o-mat20-Aug-09 22:57 
GeneralRe: Multiple Child Dialogs Pin
SutterA20-Aug-09 23:04
SutterA20-Aug-09 23:04 
GeneralRe: Multiple Child Dialogs Pin
Code-o-mat20-Aug-09 23:09
Code-o-mat20-Aug-09 23:09 
GeneralRe: Multiple Child Dialogs Pin
SutterA20-Aug-09 23:16
SutterA20-Aug-09 23:16 
QuestionMessge "the device is not ready" occur. Pin
Le@rner20-Aug-09 20:41
Le@rner20-Aug-09 20:41 
AnswerRe: Messge "the device is not ready" occur. Pin
_AnsHUMAN_ 20-Aug-09 21:51
_AnsHUMAN_ 20-Aug-09 21:51 
GeneralRe: Messge "the device is not ready" occur. Pin
Le@rner20-Aug-09 21:57
Le@rner20-Aug-09 21:57 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.