CodeIgniter Forums
[validation] problem with validation library and htmlentites (strange conversion) - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: [validation] problem with validation library and htmlentites (strange conversion) (/showthread.php?tid=3572)



[validation] problem with validation library and htmlentites (strange conversion) - El Forum - 10-11-2007

[eluser]ariok[/eluser]
Hi !
I have a problem with this code

Code:
$arr_data = array (
   "first"=>htmlentities ($this->validation->first),
   "last"=>$this->validation->last,
   "email"=>$this->validation->email,
   "username"=>$this->validation->username,
   "password"=>$this->validation->password,
   "sede"=>$this->validation->sede
);

$this->db->insert("pnl_users",$arr_data);

In "first" field i try to use an htmlentites conversion, but when i insert the char 'à'
i obtain this conversion "Atilde sup2"(Ã&sup2Wink instead of "agrave"(&agraveWink

Could you help me??

(i also tried to apply html entities directly in rules with $rules["first"]="htmlentities" but nothing changes)


[validation] problem with validation library and htmlentites (strange conversion) - El Forum - 10-11-2007

[eluser]ariok[/eluser]
i wrote this code in a class....to see what this expression produce..
Code:
echo (htmlentities("à"));

and i got the same problem... Atilde..instead agrave.... why???


[validation] problem with validation library and htmlentites (strange conversion) - El Forum - 10-11-2007

[eluser]ariok[/eluser]
ok.. i found where's the problem....the problem is DREAMWEAVER!Tongue
In my dreamerver settings i set "utf-8" as charset but it seems to use another strange charset notwithstanding my settings.
In fact if i open file where i wrote "echo (htmlentites("à"))" with another (opensource and freeware) software i read
"echo htmlentites("Ã");" ... really strange