1

this is my code:

String comment = newComment.getText().toString();
...

fields.put("push[array][]", comment);

now, it's work well , but if the string "comment" contain for example: ' , ' (comma) - ("dsa,dsa").

on the server it's become two variables: [dsa , dsa].

another example: if the string "comment" contain: ' " ' (qoute) - ("dsa "dsa" dsa").

on the server it's : [dsa \dsa\ dsa].

how to fix it?

Cohelad
  • 121
  • 9
  • I am not familiar with quickblox api but does it fix it self when you try to get it back? For the quote case try escaping the quote in the actual string so if you have "dsa "dsa" dsa" use "dsa \"dsa\" dsa" – Naveed Feb 12 '14 at 17:26
  • thanks, it doesn't fix it self, i'v tried this for the quote case - doesn't work. – Cohelad Feb 12 '14 at 17:30
  • Did you try dsa%2Cdsa ? – Rubycon Feb 13 '14 at 21:07
  • thanks, i will try it, but what to do with quote? – Cohelad Feb 14 '14 at 08:41
  • it's doesnt fix it self, so ur solution is to replace all problematic characters to somthing else - comment.replaceAll(",", "%2C"); - and back when return it from quickblox? do you know what are all the problematic characters? – Cohelad Feb 14 '14 at 10:35

1 Answers1

0

You can check this document for more details.

Darya
  • 134
  • 3