Hey,
I have an awkward situation where I am outputinh html from a feed where "`" is being used as "quotes" instead of " or "...the output is coming out with a "’" instead. How can I convert these types of quotes so they come out like they should?
Character decoding
Moderator: General Moderators
- JAB Creations
- DevNet Resident
- Posts: 2341
- Joined: Thu Jan 13, 2005 6:44 pm
- Location: Sarasota Florida
- Contact:
Re: Character decoding
I usually have this problem with third party scripts.
In general I view the source code and look for the HTML entity. For example in XHTML (when served as application/xhtml+xml) ampersands must be encoded otherwise your page breaks. The W3C site has a good basic introduction to HTML entities as well as a long list of HTML entities.
â = Â or Â
This is the only HTML entity I could find on the reference page (just look up HTML entities on your favorite search engine and eventually you'll come across a more complete list).
What I do at this point is more of a personal preference. I don't muck around in the Linux console so I use a GUI program called Advanced Find & Replace. I target the third party folder (such as a WordPress blog or whatever third party script your page is being by), and in the replace tab do a simple find for Â. I'd also repeat for Â. A list of files will appear hopefully (the fewer the better). Naturally you'll open the files that contain the string you searched for and you should be able to manually edit the file(s).
Keep in mind when you manually edit non-template files and the third party module receives updates you'll add more work to maintaining your patch for every new version that you decide to update to. At that point you'll most likely want to post some mention of this on that third party module's forums to suggest a more user friendly way to maintain the ability to manipulate that aspect of their script.
Good luck!
In general I view the source code and look for the HTML entity. For example in XHTML (when served as application/xhtml+xml) ampersands must be encoded otherwise your page breaks. The W3C site has a good basic introduction to HTML entities as well as a long list of HTML entities.
â = Â or Â
This is the only HTML entity I could find on the reference page (just look up HTML entities on your favorite search engine and eventually you'll come across a more complete list).
What I do at this point is more of a personal preference. I don't muck around in the Linux console so I use a GUI program called Advanced Find & Replace. I target the third party folder (such as a WordPress blog or whatever third party script your page is being by), and in the replace tab do a simple find for Â. I'd also repeat for Â. A list of files will appear hopefully (the fewer the better). Naturally you'll open the files that contain the string you searched for and you should be able to manually edit the file(s).
Keep in mind when you manually edit non-template files and the third party module receives updates you'll add more work to maintaining your patch for every new version that you decide to update to. At that point you'll most likely want to post some mention of this on that third party module's forums to suggest a more user friendly way to maintain the ability to manipulate that aspect of their script.
Good luck!