DB = Postgres , UTF-8
Using PHP I am trying to insert Kannada words into database. File has
tag, inserting properly into database and retrieving properly(same character encoding as entered).
my requirement is
- before inserting into database is it possible to get htmlentity like ಅ, ಆ for the characters. I tried htmlentity,html specialchars nothing works
- after successful insertion while displaying also both functions not working
My code
Using PHP I am trying to insert Kannada words into database. File has
Code:
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
my requirement is
- before inserting into database is it possible to get htmlentity like ಅ, ಆ for the characters. I tried htmlentity,html specialchars nothing works
- after successful insertion while displaying also both functions not working
My code
Code:
$kanstring = pg_escape_string($_POST['kantext']);
$array = explode(',', $kanstring);
foreach ($array as &$arr) {// if textarea contains multiple words
$data = htmlentities($arr, ENT_COMPAT, 'UTF-8');
echo "data " . $data . "";
...
Comment