Click here to Skip to main content
15,914,594 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: c++ Inheritance Question Pin
sashoalm21-Aug-09 1:12
sashoalm21-Aug-09 1:12 
QuestionVC++ Capture image using PMD Camera Pin
maherjas21-Aug-09 0:12
maherjas21-Aug-09 0:12 
AnswerRe: VC++ Capture image using PMD Camera Pin
Adam Roderick J21-Aug-09 1:08
Adam Roderick J21-Aug-09 1:08 
QuestionGetting file pointer (*FILE) Pin
Azghar Hussain20-Aug-09 23:51
professionalAzghar Hussain20-Aug-09 23:51 
AnswerRe: Getting file pointer (*FILE) Pin
sashoalm21-Aug-09 1:08
sashoalm21-Aug-09 1:08 
GeneralRe: Getting file pointer (*FILE) Pin
Azghar Hussain21-Aug-09 2:09
professionalAzghar Hussain21-Aug-09 2:09 
QuestionRasSetEntryProperties() function not working properly in vista. Pin
birajendu20-Aug-09 23:23
birajendu20-Aug-09 23:23 
QuestionURL encoding/decoding function for C++ Pin
sashoalm20-Aug-09 22:43
sashoalm20-Aug-09 22:43 
Anyone know a C++ function or library that can be used for percent decoding? I need a function that can take urls of the type "http%3A%2F%2Fwhatever.com" and turn it into "http://whatever.com". I searched on google but couldn't find anything.

I hope there is a standard function in some library (may be boost, I've heard it has nearly everything in it). But since URL decoding is a common problem there has to be some pre-cooked solution for it.

Write now I use code that I've written myself but it only works for 5-6 of the most common symbols, and it's definately not optimized!

std::string s2;
s2.reserve(m_RealUrl.size());
for (size_t i = 0; i < m_RealUrl.size(); i++)
{
    if (m_RealUrl[i] == '%')
    {
        if (!strncmp(&m_RealUrl[i], "%3A", 3))
            s2 += ':';
        else if (!strncmp(&m_RealUrl[i], "%2F", 3))
            s2 += '/';
        else if (!strncmp(&m_RealUrl[i], "%3F", 3))
            s2 += '?';
        else if (!strncmp(&m_RealUrl[i], "%3D", 3))
            s2 += '=';
        else if (!strncmp(&m_RealUrl[i], "%26", 3))
            s2 += '&';
        else if (!strncmp(&m_RealUrl[i], "%25", 3))
            s2 += '%';
        i += 2;
    }
    else
        s2 += m_RealUrl[i];
}


There is sufficient light for those who desire to see, and there is sufficient darkness for those of a contrary disposition.
Blaise Pascal

AnswerRe: URL encoding/decoding function for C++ Pin
Code-o-mat20-Aug-09 22:55
Code-o-mat20-Aug-09 22:55 
AnswerRe: URL encoding/decoding function for C++ Pin
Randor 20-Aug-09 22:55
professional Randor 20-Aug-09 22:55 
GeneralRe: URL encoding/decoding function for C++ Pin
sashoalm20-Aug-09 23:39
sashoalm20-Aug-09 23:39 
AnswerRe: URL encoding/decoding function for C++ Pin
Hristo-Bojilov20-Aug-09 22:57
Hristo-Bojilov20-Aug-09 22:57 
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 
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 

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.