views:

42

answers:

2

Hi there,

I am trying to get UTF-8 encoding working with CKEditor/PHP/MySQL/HTMLPurifier.

I have converted the character sets of the database tables/fields to utf8-unicode-ci.

I have set the following in the ckeditor config:

config.entities = true;
config.entities_latin = true;
config.entities_greek = true;
config.entitles_processNumerical = true; 

And PHP is purifying the HTML with HTMLPurifier with the default settings.

I'm not sure if I'm doing the right thing for trying to accept UTF-8, but characters such as α are working... but for some reason, any '+' in the text just simply disappears.

Any ideas?

A: 

Make sure that the text is urlencoded before post request.

If you do not 'urlencode' the text then the '+' character will be treated as space. If you urlencode the text then the '+' character will look like: '%2B'.

Vikash
A: 

I had unnecessarily urlencoded the text before the post request, while jQuery/AJAX was already encoding it. Removed the javascript encode() and the PHP urldecode() and it fixed the problem.

David Lawson