Hi All,
I have an Editor through which I want to send Greek Symbols for which I am using Α etc representation.
I have an HTML template page where this Editor is called.
Through MOOTOOLs ajax function, I am sending it to PHP which inserts the content of the Editor into MySQL Database.
The problem:
Then I have to retrieve the content. On retrieval, the Symbols are lost - I mean they are not shown as symbols but some gibberish/ gobblygook characters.
I read couple of forums: They say it is Character Set problem. I tried these things:
changed the <meta tag content type > to "UTF-8" in HTML file.
Editor Content is encoded before sending to PHP. Ajax function of Mootools is by default - UTF-8
Till this point, the symbols are seen correct - as seen in the firebug tracker on firing ajax request.
In PHP - I use HTMLEntities function and encode , then add slashes using addslashes.
Then - I send the content to MYSQL. where I have used specific - set names utf-8 and
set character set UTF-8 as well.
I hope I am doing the right thing.
When I started retrieving the content, I use stripslashes, then html_entity_dec ode , then via ajax, gets back to the editor where it is again decoded.
At this point, the characters have lost their meaning - they are some thing else. no more symbols.
Where am I going wrong ? This seems to be a common problem. I read the earlier posts as well, but I could not get a concrete solution. So I tried all that was available as suggestions. but to no use.
for testing : http://sgwiki.sdsc.edu ,
login: guest
password: guest123
browse and pick any name listed and start editing for example : Abstract. Enter symbols using the 'a' icon in the editor tool bar.
publish it you will see the problem.
Any suggestions will be greatly appreciated.
Thank you very much.
Prasad.
I have an Editor through which I want to send Greek Symbols for which I am using Α etc representation.
I have an HTML template page where this Editor is called.
Through MOOTOOLs ajax function, I am sending it to PHP which inserts the content of the Editor into MySQL Database.
The problem:
Then I have to retrieve the content. On retrieval, the Symbols are lost - I mean they are not shown as symbols but some gibberish/ gobblygook characters.
I read couple of forums: They say it is Character Set problem. I tried these things:
changed the <meta tag content type > to "UTF-8" in HTML file.
Editor Content is encoded before sending to PHP. Ajax function of Mootools is by default - UTF-8
Till this point, the symbols are seen correct - as seen in the firebug tracker on firing ajax request.
In PHP - I use HTMLEntities function and encode , then add slashes using addslashes.
Then - I send the content to MYSQL. where I have used specific - set names utf-8 and
set character set UTF-8 as well.
I hope I am doing the right thing.
When I started retrieving the content, I use stripslashes, then html_entity_dec ode , then via ajax, gets back to the editor where it is again decoded.
At this point, the characters have lost their meaning - they are some thing else. no more symbols.
Where am I going wrong ? This seems to be a common problem. I read the earlier posts as well, but I could not get a concrete solution. So I tried all that was available as suggestions. but to no use.
for testing : http://sgwiki.sdsc.edu ,
login: guest
password: guest123
browse and pick any name listed and start editing for example : Abstract. Enter symbols using the 'a' icon in the editor tool bar.
publish it you will see the problem.
Any suggestions will be greatly appreciated.
Thank you very much.
Prasad.
Comment