I am writing user inputs into a xml file. This file is then read in using the DOMdocument object.
How do I encode the following string:
"Billy’s &"
Please be aware that this ' is different from ’
ut8_encode encodes the funny apostrophe but not the ampersand. htmlentities encodes the ampersand but not the funny apostrophe.
Can someone help?
ut8 encoding issue
Moderator: General Moderators
Re: ut8 encoding issue
So... do both. htmlentities first, utf8_encoding second.condorchou wrote:ut8_encode encodes the funny apostrophe but not the ampersand. htmlentities encodes the ampersand but not the funny apostrophe.
-
condorchou
- Forum Newbie
- Posts: 2
- Joined: Wed Feb 11, 2009 10:24 pm
Re: ut8 encoding issue
That was awesome. I thought I did this combination earlier today but the output was completely jibberish but trying it just now it worked. I still don't believe it. thanx.