|
Posted by Tamer on 03/20/06 04:42
Hi!
I'd like to write a small application that converts me letters from
arabic to UTF-8 values. For that I am using the "UnicodeString.php" class.
However, if I type in the form the arab text, the result is not what I
expected.
For any help solving my problem, thank you!
Here the code:
<html>
<head>
<meta http-equiv="content-type" content="text/html;charset=utf-8" />
<title>Formular</title>
</head>
<body>
<pre>
<center>
<?php
require_once('Form.php');
require_once('UnicodeString.php');
$Serverhost = $_SERVER["HTTP_HOST"];
$Script = $_SERVER["SCRIPT_NAME"];
$Alles = 'http://'."$Serverhost"."$Script";
$UniForm = new
HTML_Form("$Alles",'get','UTFForm','_self','text/plain','accept-charset="UTF-8"');
$UniForm->addText('eingabe','','null',50,50);
$UniForm->addSubmit('','Send');
$UniForm->display('','Mach schon!');
$eingabe = $_GET[eingabe];
// var_dump($eingabe);
$MeinZeichen = new I18N_UnicodeString($eingabe,'UTF-8');
$MeinZeichen->_unicode;
$eingabe2 = $MeinZeichen->_stringFromHtml($eingabe);
$anzahl = count($eingabe2);
?>
</center>
<?php
for($i=0;$i<$anzahl;$i++)
{
print "&#".$eingabe2[$i];
}
?>
</caption>
</pre>
</body>
</html>
[Back to original message]
|