[TYPO3-english] JSON string and stdWrap.br = 1

horace grant horace3d at gmail.com
Wed Jul 9 15:37:06 CEST 2014


On Wed, Jul 9, 2014 at 12:43 AM, Stephan Schuler <
Stephan.Schuler at netlogix.de> wrote:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA256
>
> Hey there.
>
> If you care about line breaks inside your JSON strings you're doing
> something wrong, imho.
>
> Code:
> > <?PHP
> > echo json_encode("foo
> > bar");
>
> Result:
> > "foo\nbar"
>
> So json_encode already handles line breaks properly.
>
> Could you elaborate a bit why exactly this is a problem for you? Maybe you
> can work around this by creating that json string slightly different. What
> about your editors typing "\n" (backslash n) in the RTE? Will this
> transport "backslash n" or is this just another thing that breaks your
> output?
>
> I strongly suggest to use json_encode.
>


i tried to output the json with pure typoscript. :) sometimes i wish
typoscript was more like a normal programming language since it can be
quite confusing and limited at times.

but since i didn't find a solution with pure typoscript (i use 4.5 LTS) i
use some php code now too in a userfunc.

thanks for your answers!
cheers,
horace



>
> Regards,
>
> Stephan Schuler
> Web-Entwickler
>
> Telefon: +49 (911) 539909 - 0
> E-Mail: Stephan.Schuler at netlogix.de
> Website: media.netlogix.de
>
>
>
>
>
>
> - --
> netlogix GmbH & Co. KG
> IT-Services | IT-Training | Media
> Neuwieder Straße 10 | 90411 Nürnberg
> Telefon: +49 (911) 539909 - 0 | Fax: +49 (911) 539909 - 99
> E-Mail: info at netlogix.de | Internet: http://www.netlogix.de
>
> netlogix GmbH & Co. KG ist eingetragen am Amtsgericht Nürnberg (HRA 13338)
> Persönlich haftende Gesellschafterin: netlogix Verwaltungs GmbH (HRB 20634)
> Umsatzsteuer-Identifikationsnummer: DE 233472254
> Geschäftsführer: Stefan Buchta, Matthias Schmidt
>
>
>
> ________________________________________
> Von: typo3-english-bounces at lists.typo3.org [
> typo3-english-bounces at lists.typo3.org]&quot; im Auftrag von &quot;horace
> grant [horace3d at gmail.com]
> Gesendet: Montag, 7. Juli 2014 14:43
> An: TYPO3 English
> Betreff: [TYPO3-english] JSON string and stdWrap.br = 1
>
> hi,
>
> i have to output the content of some RTE field to a string in a json
> object. this leads to problems when there are line breaks. so i though i
> use:
>
> stdWrap.br = 1
>
> to convert line breaks to <br /> tags. well, there are <br /> tags now, but
> the line breaks also still are there.
>
> how could i solve this?
> _______________________________________________
> TYPO3-english mailing list
> TYPO3-english at lists.typo3.org
> http://lists.typo3.org/cgi-bin/mailman/listinfo/typo3-english
>
> -----BEGIN PGP SIGNATURE-----
> Version: PGP Universal 3.3.2 (Build 15238)
> Charset: utf-8
>
> wpUDBQFTvHQRpp0IwsibV8MBCK79A/0c3nKZFyEPvHywuTWF4yZlOIw/IyAu7IHu
> RhZcezZ4sEKDKHIKwxCZIczVuZj/sWTXKNBlhtL81aSbDWW/nhgTlv30KkXVlqbW
> g8PGMKdRLbMkse3PKxsqaWlv+5SCsGDS8bGABWY0C9UOH9nJkT3F4vBIjt6EIAOs
> 1Jc05rbw4w==
> =h9am
> -----END PGP SIGNATURE-----
> _______________________________________________
> TYPO3-english mailing list
> TYPO3-english at lists.typo3.org
> http://lists.typo3.org/cgi-bin/mailman/listinfo/typo3-english
>


More information about the TYPO3-english mailing list