When I have this filter enabled in an input format, and there are unencoded special characters such as registration symbol and em dashes, etc, extra codes appear around them whether they're in links or not.
Examples, ® rather than just ® or â rather than -
I have the problem when ELF is the only filter enabled so it doesn't seem to be a conflict issue with other filters. When I turn it off, the extra characters disappear.
Drupal 6.16, ELF 2010/04/27
| Comment | File | Size | Author |
|---|---|---|---|
| #3 | elf-787980-3.patch | 701 bytes | fuerst |
Comments
Comment #1
Anonymous (not verified) commentedI have the same problem
Comment #2
fuerst commentedThat seems to be a problem with the underlying libxml2 library used by PHP.
Workaround is to convert the text to ISO-8859-1 by using http://de2.php.net/utf8_decode before loading the text:
$doc->loadHTML(utf8_decode($text));Not an ideal solution though. Probably using PHP's DOMDocument isn't the way to go for this module? This class isn't used in Drupal elsewhere AFAIK. May be for good reason.
Comment #3
fuerst commentedHm, looks like the solution is easy and libxml is not to be blamed:
loadHTMLexpects the encoding set in the<head>section of an HTML document. See first comment in http://de2.php.net/manual/en/domdocument.loadhtml.php.Adding
<head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"/></head>to the text before loading it works for me.Patch attached.
Comment #4
troybthompson commentedExcellent, that worked for me.
Comment #5
fuerst commentedWell, so you may set this issue status to "reviewed & tested by the community" to let the maintainer know. Thanks!
Comment #6
troybthompson commentedComment #7
xanoThanks a lot!
Fixed and committed.
Comment #9
vitok-dupe commentedNow encoding problem in D7 version. If save node in English all fine, but then i save in Russian, I get a mess of hieroglyph. At the edit page all Russian letter in normal.
Comment #10
xanoCan you give step-by-step instructions to reproduce the problem?
Comment #11
xanoPlease open this issue again if you can provide step-by-step instructions on how to reproduce the problem using a clean installation and the latest dev versions of Drupal and External Links Filter.