Page 1 of 1

Private Message System - Comments don't treat accents.

Posted: Sun Apr 08, 2012 10:49 pm
by bluebird
Hi,

I've followed the tutorial for the private message system. Everything works as expected, only that the system is meant for french users, so what users publish contains accents. So far, I've fixed it so if I manually insert content inside the database, the system will display the accents correctly. I am therefore assuming that the problem come from when content is inserted by the system into the tables inside the database. The accents are not recognized inside the darabase, even, which could explain why they aren't displayed when queried by the system.

I would greatly appreciate your help with this.

Re: Private Message System - Comments don't treat accents.

Posted: Mon Apr 09, 2012 4:33 am
by bluebird
I fixed this problem by removing htmlentities() around my post variables.

Re: Private Message System - Comments don't treat accents.

Posted: Mon Apr 09, 2012 2:50 pm
by Temor
htmlentities has a second parameter where you can set encoding.
htmlentities($string, ENT_COMPAT, 'UTF-8');
I think UTF-8 has support for accents. No promises though.
check out the php docs page for more in depth info
http://php.net/manual/en/function.htmlentities.php

Re: Private Message System - Comments don't treat accents.

Posted: Tue Apr 10, 2012 3:38 pm
by jacek
Temor wrote:I think UTF-8 has support for accents.
Yup :D

Re: Private Message System - Comments don't treat accents.

Posted: Sun May 06, 2012 3:18 am
by bluebird
Thanks!