Цитата:
\u041f\u0440\u0438\u0432\u0435\u0442
CODE:
#define CP_ACP 0
external(INT, "WideCharToMultiByte", "WideCharToMultiByte", "Kernel32.dll");
messagebox(strhextodec2("Hello \u041f\u0440\u0438\u0432\u0435\u0442"));
function strhextodec2(string Text)
{
string result, num[25000];
char wchar[4], tchar[1];
int k = regexsearch(25000, #num[0], Text, "\\u[a-fA-F\d]{4}|.");
for(int i=0; i<k; i++)
{
if(size(num[i])>1)
{
strhextodec(CONVERT_TI, num[i], "\u", #num[i]);
writeaddress(formatsn(num[i]), address(#wchar[0]));
WideCharToMultiByte(CP_ACP, 0, address(#wchar[0]), 1, address(#tchar[0]), sizearray(tchar), 0, 0);
result=result+format(#tchar[0], 1);
}
else result = result + num[i];
}
return result;
}
external(INT, "WideCharToMultiByte", "WideCharToMultiByte", "Kernel32.dll");
messagebox(strhextodec2("Hello \u041f\u0440\u0438\u0432\u0435\u0442"));
function strhextodec2(string Text)
{
string result, num[25000];
char wchar[4], tchar[1];
int k = regexsearch(25000, #num[0], Text, "\\u[a-fA-F\d]{4}|.");
for(int i=0; i<k; i++)
{
if(size(num[i])>1)
{
strhextodec(CONVERT_TI, num[i], "\u", #num[i]);
writeaddress(formatsn(num[i]), address(#wchar[0]));
WideCharToMultiByte(CP_ACP, 0, address(#wchar[0]), 1, address(#tchar[0]), sizearray(tchar), 0, 0);
result=result+format(#tchar[0], 1);
}
else result = result + num[i];
}
return result;
}