2009年2月22日星期日

RE: [fw-mvc] Zend JSON encoder / decode bug with line breaks (encoder won't convert to "\n")

Yes, Json is enabled on the server and the version I use is : "json version     1.2.1 " ; for php it's 5.2.8. Maybe I can try to upgrade this ?

Z.

> > I'm using this function to send back Json data :
> >
> > public function sendJson($data)
> > {
> > $this->_helper->viewRenderer->setNoRender();
> > $this->getResponse()->setHeader('content-type', 'application/
> > json');
> > echo Zend_Json::encode($data);
> > }
> >
> > However when I'm using a line break, the encoder fails to convert it to "\n" as
> > it should normally.
> >
> > Is this normal ?
>
> I've often sent back JSON payloads with line breaks without issue. To
> narrow this issue down, is ext/json installed and enabled on your
> server? (phpinfo will tell you this) That way we'll know if it's an
> issue with ext/json or Zend_Json_Encoder. If ext/json is enabled, what
> version of PHP are you using?
>
> --
> Matthew Weier O'Phinney
> Software Architect | matthew@zend.com
> Zend Framework | http://framework.zend.com/


Tous vos amis discutent sur Messenger, et vous ? Téléchargez Messenger, c'est gratuit !

没有评论: