- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
- 34
- 35
- 36
- 37
- 38
- 39
- 40
- 41
- 42
- 43
- 44
- 45
- 46
- 47
- 48
- 49
- 50
- 51
- 52
//cgi_http.cpp
#include "http.h"
#include <cstring>
#include <cstdlib>
//decodes uri-encorded string
char* uri_decode(char* source, char* dest)
{
//save pointer address for dest
char* p = dest;
char* src = source;
while(*src)
{
if(src == strstr(src,"%B8"))
{
*p = 'ё';
src = src + 3;
p++;
}
else if(src == strstr(src,"%E9"))
{
*p = 'й';
src = src + 3;
p++;
}
else if(src == strstr(src,"%F6"))
{
*p = 'ц';
src = src + 3;
p++;
}
else if(src == strstr(src,"%F3"))
{
*p = 'у';
src = src + 3;
p++;
}
else if(src == strstr(src,"%EA"))
{
*p = 'к';
src = src + 3;
p++;
}
else if(src == strstr(src,"%E5"))
{
*p = 'е';
src = src + 3;
p++;
}
.......
Выкладываю свой чатик на С++. PHP не нужен.