[an error occurred while processing this directive]
|
#include unsigned char*temp = new unsigned char [stringsize];
E-mail:
info@telesys.ru
#include "perecod.h"
unsigned char* ToRus( unsigned char *p)
{
const static unsigned char *alf1="абвгдеёжзийклмнопрстуфхцчшщъыьэюяАБВГДЕЁЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯ";
const static unsigned char *alf2="\xA0\xA1\xA2\xA3\xA4\xA5\xF1\xA6\xA7\xA8\xA9\xAA\xAB\xAC\xAD\xAE\xAF\xE0\xE1\xE2\xE3\xE4\xE5\xE6\xE7\xE8\xE9\xEA\xEB\xEC\xED\xEE\xEF\x80\x81\x82\x83\x84\x85\x86\xF0\x87\x88\x89\x8A\x8B\x8C\x8D\x8E\x8F\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9A\x9B\x9C\x9D\x9E\x9F";
static bool flag=0;
static unsigned char cod[255];
unsigned char *q;
int stringsize=0;
q=p;
while(*q!='\0')
{
stringsize++ ;
q++;
}
strcpy(temp, p);
if(!flag)
{
for(unsigned char i=0;i<255;i++)
{
cod[i]=i;
}
for(int i=0;i<66;i++)
{
cod[alf1[i]]=alf2[i];
}
flag=true;
}
for(unsigned int i=0;temp[i];i++)
{
temp[i]=cod[temp[i]];
}
return temp;
}
Ответы
Перейти к списку ответов
|||
Конференция
|||
Архив
|||
Главная страница
|||
Содержание