Converting HTML Entity characters into Greek using PHP

I'm using PHP in my site. I'm saving greek characters in the form of HTML entities in a database. When I retrieve the data from the database (mySQL) the server(I guess) automatically converts those special characters into the original greek writting. Is there any other way to retrieve that data as greek? I tried the htmlentities and decode php functilons, but I could not do it (I think those default methods do not support ISO greek characters). How do I do it? Examples are required.
varkonAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

compustarsgCommented:
i think you can do it with utf-8 character encoding. set mysql to utf-8.  configure php.ini to use utf-8. enable mbstring extension in php. then you can store data in greek , also can retreive and show on web pages. need more explanation ask me.
0
varkonAuthor Commented:
Unfortunately, because my site is not hosted on my machine (or a machine on which I have administrative rights) I cannot make any changes in mysql or php. I've asked the server's admins but they do not allow any changes. Is there any other way?
0
compustarsgCommented:
basically what you need is , you should set the character encoding in mysql, php to the  encoding which can store greek language. (unicode supported encodings definetly store greek letters).  find out with the server admin what is the current configurations. if they dont support greek then as i know you can't solve this.
0
Cloud Class® Course: Amazon Web Services - Basic

Are you thinking about creating an Amazon Web Services account for your business? Not sure where to start? In this course you’ll get an overview of the history of AWS and take a tour of their user interface.

varkonAuthor Commented:
Ok... I'll give it a try and get back 2u.
0
gruntarCommented:
There should be no problems storing greek characters (not entities) in your database.
You must use right codepage on your HTML pages.

I use Central eurpoean code page and mySQL serer is locatedin US with codepage Latin1 and I can save/ retrieve text without conversions.

Here is my meta tag   <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-2" />
for greek you could use
<meta http-equiv="Content-Type" content="text/html; charset=windows-1253" />
or
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-7" />

That should do the trick.

Cheers
0
varkonAuthor Commented:
gruntar thanks for the tip. However, my real problem is how to convert the characters already stored in the database (as html entities) to greek. compustarsq I was not able to "convince" the server's admins to change their configuration.
0
gruntarCommented:
Problem is that you thought of that problem a bit to late. :|
What about this http://dev.mysql.com/doc/mysql/en/replace_utility.html

or you could create new temp table with same fields and create query like this

INSERT INTO temp_table (field1, field2)
    SELECT REPLACE(field1, '&#125;', 'ö'), REPLACE(field2, '&#125;', 'ö')
    FROM your_table;

when everything is set you just rename tables.

hope that helps.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
varkonAuthor Commented:
Yeah, you are so right... I'll give it a try and let you know.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
PHP

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.