kingpin393 Posted October 8, 2008 Share Posted October 8, 2008 Hi, I am pulling data from flat text files and converting them into XML files using DOM. My problem seems to be with encoding. A lot of the flat text files have trademark symbols, degree signs, sup characters etc. When trying to add these to nodes in XML it seems to cause a problem. I understand this is because XML doesn't like these characters. I am trying to convert them using htmlentities() so that trademarks become ™ etc... The problem is when it saves them to xml it looks like ™ - it seems when the file is saved it encodes it again. I imagine this is a common issue but I could find no real help by googling it, maybe I am searching the wrong thing... Any help is appreciated. Thanks, Quote Link to comment https://forums.phpfreaks.com/topic/127541-solved-encoding-symbols-for-xml/ Share on other sites More sharing options...
kingpin393 Posted October 9, 2008 Author Share Posted October 9, 2008 I am pretty sure I figured it out. When saving to xml I let the symbols get encoded to ™ or ° etc. Then when I read the xml it auto decoded the &'s to be & and when echoing to the browser the symbols showed up correctly. Kevin Quote Link to comment https://forums.phpfreaks.com/topic/127541-solved-encoding-symbols-for-xml/#findComment-660780 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.