So, this one took me a really long time to track down, but I recently upgraded google_plusone to the 7.x-1.x-dev version, which had the side effect of causing several insidious problems, but the main one being that a byte order marker (bom) was being put on pages before output. This was at its worst when delivering json content using the services module, because the BOM was getting output at the beginning of the string.

These markers don't render in many editors or browsers, though you may see gibberish such as 
In less the character would show as U+FEFF

I found these by using the advice here: http://stackoverflow.com/questions/204765/elegant-way-to-search-for-utf-...

grep -rl $'\xEF\xBB\xBF' .

This showed the culprits were two files google_plusone_badge.admin.js and google_plusone.module, both at the beginning of the file.

A diff is attached, or you can use find . -type f -exec sed '1s/^\xEF\xBB\xBF//' -i.bak {} \; -exec rm {}.bak \;

CommentFileSizeAuthor
google_plusone_fix_bom.patch545 bytescoderintherye
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

corbacho’s picture

Assigned: Unassigned » corbacho
Status: Needs review » Needs work

Wow. Thanks a lot for the time to track it down and report this nasty issue. I know by experience that json encoding issues are painful.

I ran that grep command in my environment and I can see the same two files affected. Funny that no other files in my system (edited by me) has that issue. Most probably was a commit I did from other machine

I will fix ASAP, most probably tomorrow

coderintherye’s picture

Thanks for taking a look and getting it fixed. Much appreciated.

corbacho’s picture

Status: Needs work » Fixed

Thanks for contributing to the module: http://drupal.org/node/1175696/commits
Fix is already in -dev release. I want to take a look also to other bug report and update module with couple of new features before I make a new stable release.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.