ForumsDevelopersParse line breaks


Parse line breaks
Author Message
fabian.hoeger

Posted: Jun 08, 2011
Score: 0 Reference
I have a C# string like this "example\rbreak"
After concerting it with HttpUtility.UrlEncode("example\rbreak") it will be converted to:
example%0dbreak
but if I like to add the task I get a error.
4 : You didn't specify any tasks to add/edit/delete.

JSON example:
http://api.toodledo.com/2/tasks/add.php?key=6c2910591f91cf1e08dcd7b343907910;tasks=[{"title"%3A"Tttt "%2C"note"%3A"Xxxx%0dxxxx"%2C"folder"%3A"0"%2C"tag"%3A""%2C"duedate"%3A"1307577600"%2C"duetime"%3A"1 307620800"%2C"priority"%3A"-1"%2C"completed"%3A"0"}];

Any suggestions?


This message was edited Jun 09, 2011.
Jake

Toodledo Founder
Posted: Jun 08, 2011
Score: 0 Reference
\r should not end up encoded as %0d. This is interpreting it as a single character, which would normally be true, but since it is wrapped in a JSON object, you actually need to treat it as a two character string, which would get encoded as %5Cr.

By the way, I hope that wasn't a real key, because otherwise you gave everyone access to that account for 4 hours.
fabian.hoeger

Posted: Jun 16, 2011
Score: 0 Reference
And \r which ends up in %0a should be encoded as %5cr, too?
Jake

Toodledo Founder
Posted: Jun 16, 2011
Score: 0 Reference
Yes
You cannot reply yet

U Back to topic home

R Post a reply

To participate in these forums, you must be signed in.