iphone - Issue with newline in text - UITextView to sqlite, sqlite to JSON (via NSString), JSON to PHP -


i have uitextview ends sending text sqlite db on iphone. later on querying data sqlite, putting json string , sending server (php/mysql) iphone using asihttprequest (using asiformdatarequest class).

there data condition send php fails decode (using json_decode). data condition seems there's newline in text entered sqlite via uitextview.

things i've tested:

  • write out same json string i'm trying send server text file on iphone. take text, copy web form (that put troubleshooting) posts data same php script accepts json iphone. processes (e.g. decodes , writes mysql db).
  • write out same json string i'm trying send server console (using nslog). copy text console , copy web form posts data same php script accepts json iphone. processes (e.g. decodes , writes mysql db).
  • remove newline in sqlite db, run app , send json server per design, no problem...it decodes , writes mysql db.

i want keep newline in text user typed , expect when see information on server. not sure how keep newline , @ same time able send data server without issues.

thanks,
shawn

how creating json string?

the newline should encoded in json 2 characters: \n


Comments

Popular posts from this blog

c# - how to write client side events functions for the combobox items -

exception - Python, pyPdf OCR error: pyPdf.utils.PdfReadError: EOF marker not found -