php - stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding not working for UITextView -
i have search field, uitextview
, user enters data searched in mysql database in server.
the search , php xcode calls work normal characters, encoding doing not seem work correctly special characters such ā, example. have managed save data special characters mysql database, reason code doing search not seem encode data correctly.
the current code have is:
nsstring *searchstring; searchstring = [searchtextfield.text stringbyaddingpercentescapesusingencoding:nsutf8stringencoding]; searchstring = [searchstring stringbyreplacingoccurrencesofstring:@" " withstring:@"%20"];
searchtextfield.text
uitextview
. ideas why not working?
ok - have solved problem don't understand why. grateful explanations.
the way have solved problem, way seems using hammer crack nut, saving string searching in sqlite database. once saved, assigned searchstring , gets encoded properly.
can explain why case?
Comments
Post a Comment