Why you don't use the code I posted?
If you already took one line, why you cannot apply wcstombs?
How I see it should be something like
_wsetlocale(LC_ALL, L"arabic");
TCHAR* urlcnw = (wchar_t*)malloc(1024);
urlcnw[0] = 0;
mbstowcs(urlscnw, urlcn, 1000);
Do not forget to delete this urlcnw when you will not need it. It is correct for your code with A2T too.