transformation of  

54 views
Skip to first unread message

Sean Dague

unread,
May 8, 2012, 6:36:57 AM5/8/12
to meetu...@googlegroups.com
I had just tried to get my drupal meetup_events module lit on a new site
and ran into problems. I eventually narrowed them down to the fact that
when you feed   into meetup for the description of an event, the
returned JSON has trasnformed that into some other (possibly unicode?)
character. PHP's json_decode completely chokes on that. Remove the
  and life is fine.

I can fix this by just scrubbing the   on the push, but I'm
currious what's going on here, and if this is intended behavior in the
json API.

Thanks,

-Sean

--

Sean Dague Mid-Hudson Valley
se...@dague.net Linux Users Group
http://dague.net http://mhvlug.org

Doug Tangren

unread,
May 8, 2012, 11:07:29 AM5/8/12
to meetu...@googlegroups.com
On Tue, May 8, 2012 at 6:36 AM, Sean Dague <se...@dague.net> wrote:
I had just tried to get my drupal meetup_events module lit on a new site and ran into problems. I eventually narrowed them down to the fact that when you feed &nbsp; into meetup for the description of an event, the returned JSON has trasnformed that into some other (possibly unicode?) character. PHP's json_decode completely chokes on that. Remove the &nbsp; and life is fine.

I can fix this by just scrubbing the &nbsp; on the push, but I'm currious what's going on here, and if this is intended behavior in the json API.


Hi Sean,

Thanks for reporting this issue. Meetup has recently converted our default character set encoding on the site to utf8. What you are most likely seeing is a utf8 encoded variant of &nbsp;

You may notice that many of our API methods still return a the ISO-8859-1 character set encoding so we don't break apps that can't handle utf88.

curl -i 'http://api.meetup.com/2/event/EVENT_ID?key=API_KEY'

When you specific a charset of utf8 explicitly we return that encoding. In the example call below. You'll see spaces instead of question marks for encoded spaces.

curl -i -H 'Accept-Charset:utf-8' 'http://api.meetup.com/2/event/EVENT_ID?key=API_KEY'

Let us know if that helps resolve the situation you are in. We are working on a way to resolve this issue in the API.  Thank you for your patience.

Doug Tangren
Meetup
API Team

 
Thanks,

       -Sean


--

Sean Dague                                       Mid-Hudson Valley
se...@dague.net                                   Linux Users Group
http://dague.net                                 http://mhvlug.org

--
You received this message because you are subscribed to the Google
Groups "Meetup API" group.
To unsubscribe from this group, send email to
meetup-api+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/meetup-api?hl=en?hl=en

Sean Dague

unread,
May 8, 2012, 11:19:14 AM5/8/12
to meetu...@googlegroups.com
On 05/08/2012 11:07 AM, Doug Tangren wrote:
> Hi Sean,
>
> Thanks for reporting this issue. Meetup has recently converted our
> default character set encoding on the site to utf8. What you are most
> likely seeing is a utf8 encoded variant of &nbsp;
>
> You may notice that many of our API methods still return a the
> ISO-8859-1 character set encoding so we don't break apps that can't
> handle utf88.
>
> curl -i 'http://api.meetup.com/2/event/EVENT_ID?key=API_KEY'
>
> When you specific a charset of utf8 explicitly we return that encoding.
> In the example call below. You'll see spaces instead of question marks
> for encoded spaces.
>
> curl -i -H 'Accept-Charset:utf-8'
> 'http://api.meetup.com/2/event/EVENT_ID?key=API_KEY'
>
> Let us know if that helps resolve the situation you are in. We are
> working on a way to resolve this issue in the API. Thank you for your
> patience.

Ok, I'm just using
http://api.drupal.org/api/drupal/includes%21common.inc/function/drupal_http_request/6

Haven't set any headers, and I'm getting the utf-8 return. Is the
default handling with no header perhaps wrong? Should I force an
Accept-Charset:ISO-8859-1 ?

Doug Tangren

unread,
May 8, 2012, 11:27:05 AM5/8/12
to meetu...@googlegroups.com

In this case you want the Accept-Charset header to be utf-8

Sean Dague

unread,
May 8, 2012, 11:38:07 AM5/8/12
to meetu...@googlegroups.com
On 05/08/2012 11:27 AM, Doug Tangren wrote:
> Haven't set any headers, and I'm getting the utf-8 return. Is the
> default handling with no header perhaps wrong? Should I force an
> Accept-Charset:ISO-8859-1 ?
>
>
> In this case you want the Accept-Charset header to be utf-8

Ok, got it, and it seems to work.

Nathan @ Meetup

unread,
May 14, 2012, 1:51:25 PM5/14/12
to meetu...@googlegroups.com
We've launched a change related to this problem. Since nonbreaking space characters in iso-8859-1, though valid, have caused trouble for some JSON parsers, we're replacing them with plain spaces for that encoding. Responses in utf-8 will continue to include nonbreaking spaces and any other characters that make up the text.

Nathan
Reply all
Reply to author
Forward
0 new messages