The stringByReplacingPercentEscapesUsingEncoding method is not working properly as it's not decoding special symbols that dont start with a % character, i.e., the + character. Does anyone know of a better method to do this in iOS?
Here's what I'm currently using:
NSString *path = [@"path+with+spaces" stringByReplacingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
And here's an example of the output:
Is there a way to perform a MySQL query and have one of the columns in the output directly urldecode, rather than have PHP do it.
For example this table 'contacts' would contain,
------------------------------------|name |email |------------------------------------|John Smith|johnsmith%40hotmail.com|------------------------------------
SELECT * FROM `contacts`
John Smith | firstname.lastname@example.org
Is there something along the lines of,
SELECT name, urldecode(email) FROM `contacts`
John Smith | email@example.com
I'm about to create a self-hosted Web API application, and somewhere I need to URL Decode the input. But I truly don't want to add a reference to System.Web.dll, because AMAIK, it's a heavy DLL and one of the main reasons of getting far from ASP.NET and IIS.
If I'm right, and I don't add a reference to System.Web, then how can I URL Decode effectively without bugs?
I'm totally stuck.
Some background. I have an SSRS report which displays some info. I have also built a LightSwitch HTML application which allows a user to edit that same info. The goal is to allow users to directly navigate to an edit screen from within the SSRS report.
My end result would be
http://Server.Company.net/TimeLogs_LS/HTMLClient/#/ViewRecordDetails/79456/[c1e469bee](a URL which I know works)
Which I am attempting to achieve within the
Go To URL Actionvalue of a String's
TextPropertiesin SSRS using the following code:
="http://cmbapp1.brattle.net/TimeLogs_LS/HTMLClient/#/ViewRecordDetails/" & Fields!ProjectCommentKeySK.Value & "/[c1e469bee]"
The Problem I'm having is that
[c1e469bee]keeps escaping to
I have tried to follow the
Decode technique outlined here and have tried implementing
unescape() which I later saw is deprecated.
All help would be greatly appreciated.
Additionally, any suggestions about how to link to specific LightSwitch records would be nice, but I've looked into DeepLinking / URL parameters with no luck.And I have found very little discussing the URL's unique ID generation, without which the program 'breaks'
I am using SWIFT 1.2 to develop my iPhone application AND got to communicate with a http web service at a certain point....
The response I am getting is in query string format (key-value pairs) and URL encoded in .Net.
I can get the response, but looking the proper way to decode using SWIFT.
Sample response is as follows
Tried following way to decode and get the server response
// This provides encoded response Stringvar responseString = NSString(data: data, encoding: NSUTF8StringEncoding) as! Stringvar decodedResponse = responseString.stringByReplacingEscapesUsingEncoding(NSUTF8StringEncoding)!
Problem: But it haven't removed + marks (encoded spaces)
In Java (Android) I can successfully decode and get the expected response as follows
String responseStr = URLDecoder.decode(responseString, "UTF-8");
But in iOS with SWIFT it is NOT straight forward.
I just found few POSTS explaining solutions (replace + with " ", before use 'stringByReplacingEscapesUsingEncoding' method) but looking for a reliable and a straight forward way (Language API method) in SWIFT if possible
I can make this working as follows, but I am looking for a language API method if available like in java (Enode properly in one go rather than i perform replace "+" with "space" before use SWIFT method)
var result = responseString.stringByReplacingOccurrencesOfString("+", withString: " ")var decodedResponse = result.stringByReplacingPercentEscapesUsingEncoding(NSUTF8StringEncoding)!