We have a site which provides data to Rightmove via an XML file. However, we're seeing a small issue with special characters being displayed with odd symbols. For example, when smart quotes are pasted into our data source (Drupal CMS) the characters display as â€ or â€™.
Our database tables are using utf8_general_ci and everything looks fine on our site. What do I need to do to get Rightmove to display the proper characters?
I have html tags need to be encoded.
I need to encode it to :
I am using escape, but it doesn't work.
the result I got is
I am of course familiar with the
java.net.URLDecoder classes. However, I only need HTML-style encoding. (I don't want
' ' replaced with
'+', etc). I am not aware of any JDK built in class that will do just HTML encoding. Is there one? I am aware of other choices (for example, Jakarta Commons Lang 'StringEscapeUtils', but I don't want to add another external dependency to the project where I need this.
I'm hoping that something has been added to a recent JDK (aka 5 or 6) that will do this that I don't know about. Otherwise I have to roll my own.
What is the easiest way to Html encode in PHP?