I run a Swedish blog and love the trackback module, but something is happening with the character encoding. When sending trackbacks my text shows up on other sites with the Swedish characters å, ä, ö replaced by something else. e.g.

"Sara skrev igår om den kolumn i SvD i onsdags som minst sagt rörde upp känslor i mig"

is showing up as

"Sara skrev igår om den kolumn i SvD i onsdags som minst sagt rörde upp känslor i mig"

I'm guessing this has something to do with the module not converting to UTF-8?

/Per

Comments

ankur’s picture

I tried trackbacking another post and wasn't able to reproduce the error.

However, my test involved trackbacking a drupal post with a drupal post. So either drupal understands drupal's messed up transmission or, it may be that the receiving site in your case isn't handling the trackback text properly.

This will require more research...

-Ankur

axbom’s picture

Could be but other sites are pinging the same sites successfully. For example, see the following post and you will se two trackbacks there, one of which is mine. The other trackback is showing up fine wth the correct Swedish characters.

http://www.tiger.se/blog/archives/2005/05/civilkurage_ett.html

To reproduce the error why not send a trackback to an old blog entry at the same site? And also send a trackback to en entry at my site, e.g. http://www.axbom.se/blogg/semlr

ankur’s picture

I committed a fix to HEAD, DRUPAL-4-6.

I'm not sure if the commit solves the problem, I will leave this issue open until I get a confirmation that the problem is or isn't fixed.

While I was at it, I noticed a DB table naming bug and fixed that as well (yes, I know, 1 patch per bug and 1 bug per patch).

For the 2 changed lines made to the trackback.module file, please see
http://cvs.drupal.org/viewcvs/drupal/contributions/modules/trackback/tra...

If you wish to apply these changes to a non-4.6 version of trackback, you can look at the diff linked above and make the changes by hand (it's less than 2 lines of changes).

-Ankur

ankur’s picture

Assigned: Unassigned » ankur

The "fix" above doesn't work. Will try to come back with another patch. The patch in the meantime is harmless and will be invalidated by the next one. It will, again, be applied to HEAD and DRUPAL-4-6.

-ANkur

ankur’s picture

After spending a couple of days on this issue, it appears that there is no workaround or that I'm grossly missing something.

In short, I spent a couple of days exhausting the various encoding/decoding functions and with different approaches to fixing the problem.

The problem is that the original trackback specification never specified an encoding. This casuses confusion as some people end up using iso-8859-1 while others use utf-8, when everyone should really be using utf-8.

In this case, specifically, I tested trackbacks against a site whose meta tags suggested that the site used iso-8859-1. After changing trackback.module to decode from utf-8 to iso-8859-1 and hardcoding this into an installation of trackback.module, I could not get the characters to display correctly on the other end. I sent content-types that included "charset=iso-8859-1" and tried different functions to do the decoding from utf to iso-8859-1. These included iconv(), mb_convert_encoding(), as well as recode_string().

If noone else wants to try this, I will mark the issue as "won't fix" after a few days.

-Ankur

zorac’s picture

I'll try this issue.

zorac’s picture

Assigned: ankur » zorac
Status: Active » Fixed
Anonymous’s picture

Status: Fixed » Closed (fixed)