Hello ,
i have an .js file to fetch title and description from another site have utf8 charset and my site also have utf8 charset
it fetch english character well but arabic or turki character it appear such that ????????? ???? ????????
.js content
function request_videoinfo()
{
if (!fetch_object('videourl').value)
{
return false;
}
YAHOO.util.Connect.asyncRequest("POST", "video.php?do=videoinfo", {
success: handel_videoinfo,
failure: vBulletin_AJAX_Error_Handler,
timeout: 15000
}, SESSIONURL + 'securitytoken=' + SECURITYTOKEN + "&url=" + PHP.urlencode(fetch_object('videourl').value) + "&wysiwyg=" + vB_Editor[editor_id].wysiwyg_mode);
fetch_object('videoajaxbutton').value = vbphrase['requesting_information_please_wait'];
fetch_object('videoajaxbutton').disabled = true;
return false;
}
function handel_videoinfo(ajax)
{
if (ajax.responseXML)
{
// check for error first
var error = ajax.responseXML.getElementsByTagName('error');
if (error.length)
{
fetch_object('thumbnail').setAttribute('src', '');
fetch_object('thumbnail_border').style.display = 'none';
alert(error[0].firstChild.nodeValue);
}
else
{
try
{
var description = ajax.responseXML.getElementsByTagName('description')[0].firstChild.nodeValue;
vB_Editor[editor_id].insert_text(description);
}
catch (e)
{
}
try
{
var title = ajax.responseXML.getElementsByTagName('title')[0].firstChild.nodeValue;
fetch_object('videotitle').value = title;
}
catch (e)
{
}
try
{
var videothumbnailpath = ajax.responseXML.getElementsByTagName('thumbnailpath')[0].firstChild.nodeValue;
fetch_object('thumbnail').setAttribute('src', videothumbnailpath);
fetch_object('thumbnail_border').style.display = '';
}
catch (e)
{
}
}
}
fetch_object('videoajaxbutton').value = vbphrase['request_videoinfo_from_service'];
fetch_object('videoajaxbutton').disabled = false;
}