You are here: form to Unicodestring problem with arabic « PHP Programming Language « IT news, forums, messages
form to Unicodestring problem with arabic

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>

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация