String encoding/replace newline char (0x0A) objc
I'm trying to create a JSON string but my text has new lines in it and this is causing errors.
and example string for what I am trying to create can be seen below.
{"title":" Βιβλίο χωρίς υπόθεση",
"kimeno":"Μια ξανθιά πάει στον πάγκο δανεισμού της Βιβλιοθήκης και λέει:
- Δανείστηκα ένα βιβλίο την προηγούμενη βδομάδα, αλλά ήταν το πιο βαρετό βιβλίο που έχω διαβάσει ποτέ. Δεν είχε καθόλου υπόθεση, αλλά είχε υπερβολικά πολλούς χαρακτήρες.
- Ώστε εσείς λοιπόν μας πήρατε τον τηλεφωνικό κατάλογο!!! ","version":"1.3"}
As you can see above the text has new lines. I tried to replace the new line with <br> but am not having any luck. Any idea on how this can be done in obj-c? I tried to search for the hex characters 0x0A, 0x0D but that didnt work.
Any recommendations?
Thanks.
|