POST body is empty when feed contains chinese word

23 views
Skip to first unread message

YC

unread,
Jan 2, 2012, 5:26:37 AM1/2/12
to Pubsubhubbub
What steps will reproduce the problem?
1. publish blog(blogspot) with chinese word
2. uses https://pubsubhubbub.appspot.com as hub
3. write POST body into file.
4. file is empty if feed contains chinese word

File is not empty if chinese word doesn't occur.

I'm using ruby on rails. What can i do to overcome this issue?

Charl van Niekerk

unread,
Jan 2, 2012, 12:22:08 PM1/2/12
to pubsub...@googlegroups.com
2012/1/2 YC <yeou...@gmail.com>:

Sounds like you are having some type of encoding problem. Some
component in the flow of the entry (from publisher to subscriber via
the hub) is not interpreting unicode characters correctly.

The above works on the assumption that you are using an encoding such
as UTF-8 - is that indeed the case?

Assuming Blogger is not the problem, is the Ruby code you are using
unicode-safe? What if you try using a different publisher, such as
WordPress?

Tamer Yousef

unread,
Jan 2, 2012, 12:51:42 PM1/2/12
to pubsub...@googlegroups.com
I had a similar issue back in 04/2011 with blogs that had arabic words, and till now it's not resolved, it was related UTF-8 encoding. Brett said that it may fail if the feed is not using UTF-8. In my case it was blogger which is using clearly using UTF-8.

-Tamer

Charl van Niekerk

unread,
Jan 2, 2012, 2:10:18 PM1/2/12
to pubsub...@googlegroups.com
2012/1/2 Tamer Yousef <tamer....@gmail.com>:

> I had a similar issue back in 04/2011 with blogs that had arabic words, and
> till now it's not resolved, it was related UTF-8 encoding. Brett said that
> it may fail if the feed is not using UTF-8. In my case it was blogger which
> is using clearly using UTF-8.

I'm trying to reproduce the problem but am having some trouble myself.

I created a test blog:

http://charltest.blogspot.com/

This produces the following valid-looking feed:

http://www.blogger.com/feeds/4712051143568267253/posts/default

No major validation problems either:

http://is.gd/vZwLAV

The hub doesn't seem to know of any posts though (at the time of writing):

http://is.gd/uMi5Xb

I was able to subscribe to this using the PuSH Bot:

http://push-bot.appspot.com/

But am also getting no posts through the bot, either the English or
Japanese ones.

Maybe I'm doing something wrong? Been quite some time since I last used Blogger.

YC

unread,
Jan 3, 2012, 12:52:08 AM1/3/12
to Pubsubhubbub


On Jan 3, 3:10 am, Charl van Niekerk <ch...@ushahidi.com> wrote:
> 2012/1/2 Tamer Yousef <tamer.you...@gmail.com>:
Try use http://charltest.blogspot.com/feeds/posts/default instead.

YC

unread,
Jan 3, 2012, 1:36:37 AM1/3/12
to Pubsubhubbub
Here is the screenshoot from appspot subscription details.

http://i44.tinypic.com/vgocpl.png

Charl van Niekerk

unread,
Jan 3, 2012, 2:35:54 PM1/3/12
to pubsub...@googlegroups.com
2012/1/3 YC <yeou...@gmail.com>:

I actually tried to subscribe to this URL using the PuSH bot but it
recognises the other URL as that is what the rel="self" points to.

Also no stats though:

http://is.gd/3zqwBP

YC

unread,
Jan 4, 2012, 7:22:24 AM1/4/12
to Pubsubhubbub
http://groups.google.com/group/pubsubhubbub/browse_thread/thread/a88b00246f80b83c

According to this post, the feed link you should subscribe is
http://charltest.blogspot.com/feeds/posts/default .

I tried to subscribe to that url and it success. However, I'm not
using PuSH bot.

Charl van Niekerk

unread,
Jan 4, 2012, 12:27:47 PM1/4/12
to pubsub...@googlegroups.com
2012/1/4 YC <yeou...@gmail.com>:

Weird, here's what I'm getting back from the bot:

ik: /subscribe http://charltest.blogspot.com/feeds/posts/default
push-bot: You're already subscribed to
http://www.blogger.com/feeds/4712051143568267253/posts/default
(sending request to hub anyway, in case it's out of sync)
Subscribed to http://www.blogger.com/feeds/4712051143568267253/posts/default

YC

unread,
Jan 6, 2012, 11:38:01 PM1/6/12
to Pubsubhubbub
> Weird, here's what I'm getting back from the bot:
>
> ik:  /subscribehttp://charltest.blogspot.com/feeds/posts/default
> push-bot:  You're already subscribed tohttp://www.blogger.com/feeds/4712051143568267253/posts/default
> (sending request to hub anyway, in case it's out of sync)
> Subscribed tohttp://www.blogger.com/feeds/4712051143568267253/posts/default

Hmm.. not sure about that. Maybe you can try other service that use
appspot hub like feedburner.

http://code.google.com/p/pubsubhubbub/wiki/HubbubAtGoogle

Charl van Niekerk

unread,
Jan 12, 2012, 10:48:54 AM1/12/12
to pubsub...@googlegroups.com
2012/1/7 YC <yeou...@gmail.com>:

> Hmm.. not sure about that. Maybe you can try other service that use
> appspot hub like feedburner.
>
> http://code.google.com/p/pubsubhubbub/wiki/HubbubAtGoogle

Tried with Google Reader and it worked perfectly fine for both English
and Japanese posts (from what I could tell).

YC

unread,
Jan 13, 2012, 5:49:56 AM1/13/12
to Pubsubhubbub
Hi! Thanks for following up. I just found out the problem.
It was my code problem. I did not use binary flag when opening a file.
So the raw post data that contain non-english character was not
written into that file.

The following is the solution.
File.open(filename, 'wb') do |f|
f.puts request.raw_post
end

On Jan 12, 11:48 pm, Charl van Niekerk <ch...@ushahidi.com> wrote:
> 2012/1/7 YC <yeouch...@gmail.com>:

Charl van Niekerk

unread,
Jan 13, 2012, 6:41:19 AM1/13/12
to Pubsubhubbub
On 13 jan, 11:49, YC <yeouch...@gmail.com> wrote:
> Hi! Thanks for following up. I just found out the problem.
> It was my code problem. I did not use binary flag when opening a file.
> So the raw post data that contain non-english character was not
> written into that file.
>
> The following is the solution.
> File.open(filename, 'wb') do |f|
>   f.puts request.raw_post
> end

Glad to hear, and thanks for sharing the solution. I am still
wondering why the PuSH bot didn't work earlier though. Is anyone else
having problems, or is it just me?
Reply all
Reply to author
Forward
0 new messages