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 \;
Comment | File | Size | Author |
---|---|---|---|
google_plusone_fix_bom.patch | 545 bytes | coderintherye |
Comments
Comment #1
corbacho CreditAttribution: corbacho commentedWow. 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
Comment #2
coderintherye CreditAttribution: coderintherye commentedThanks for taking a look and getting it fixed. Much appreciated.
Comment #3
corbacho CreditAttribution: corbacho commentedThanks 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.