Hi Here is a small javascript to convert unicode to entities.
I have left out document.frm.submit(); from the end of the script so you can see it working.
In your php you would need to change GET to POST.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv='Content-Language' content='ur'>
<meta http-equiv='Content-Type' content='text/html; charset=utf-8'>
<title>Untitled Document</title>
<script type="text/javascript">
function doit(){
var ps2 = document.frm.passid.value;
var bb="";
for(i=0; i<ps2.length; i++){
if(ps2.charCodeAt(i)>127){
bb += '&#' + ps2.charCodeAt(i) + ';';
}
else{
bb += ps2.charAt(i);
}}
document.frm.passid.value = bb;
}
</script>
</head>
<body>
<form name="frm" id="frm" action="search.php" target="_parent" method="post">
<input type="text" name="passid" id="passid" value="بابر" >
<a href="javascript:doit();" target="_parent">test</a>
</form>
</body>
</html>
Have a Great Day!
Larry Keenan
My both files contains Character Set UTF-8.
Do you mean to write this information to any “ExeOutput for PHP” file.
[quote=“hafizsadeeq”]My both files contains Character Set UTF-8.
Do you mean to write this information to any “ExeOutput for PHP” file.[/quote]
The problem is that you’re using non ASCII characters in your URL. You should encode them.
See a sample code at http://stackoverflow.com/questions/3907995/how-to-support-utf8-japanese-arabic-spanish-urls-in-php
I recommend you to avoid Unicode characters in your HTML and use UTF-8 instead: see http://www.phpwact.org/php/i18n/charsets.
It will be better for PHP processing too, since PHP 5 doesn’t handle Unicode properly.
Hello,
We recently purchased 1.4.1 version. We are facing one problem that when we pass unicode value through url to next (php) it don’t show real value but to show ???. Please guide us how to solve this problem, we are attaching both two files. Please check it. Also note that it successfully work at localhost.
Regards
Hafiz Sadeeq
Thank you so much.
My problem solved as you mention to encode value in url.
I also thank Mr. Larry Keenan for writing code but this was not my requirement.