0
hai ,

i created one chat application by using web service, it works well. when i gave some space between the characters that is going to be quiting.. same issue is arises when i use the special characters. sometime when i give space the program can't quit. but the input message can't inserted into the web server. what method i wish to use for solving this issue.. thanks in advance..

yuvi
  • 31
  • 4

2 Answers2

0

I think what you are looking for is this method

NSString* escapedString = [string stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];

this will remove all the withe spaces of a string, and encode it correctly so it can be send through the server

Mauricio Galindo
  • 638
  • 1
  • 10
  • 16
0

I suggest you to do percent encoding of the string in client side before sending it to server, Otherwise server unable to recognise those characters.

For example: To distinguish a space character you have to use %20

If yo want to learn how to do these operation you can refer this

Community
  • 1
  • 1
raaz
  • 12,410
  • 22
  • 64
  • 81