You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by he...@apache.org on 2013/12/03 22:32:52 UTC
[09/11] git commit: CB-3035 Fix issue with windows new line char \n\r
CB-3035 Fix issue with windows new line char \n\r
Project: http://git-wip-us.apache.org/repos/asf/cordova-plugin-contacts/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-plugin-contacts/commit/72e97f30
Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugin-contacts/tree/72e97f30
Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugin-contacts/diff/72e97f30
Branch: refs/heads/dev
Commit: 72e97f3078c1dc27aadb0d40efff192dc399bd66
Parents: 148774d
Author: Jesse MacFadyen <pu...@gmail.com>
Authored: Mon Dec 2 14:02:15 2013 -0800
Committer: hermwong <he...@gmail.com>
Committed: Tue Dec 3 13:32:27 2013 -0800
----------------------------------------------------------------------
src/wp/Contacts.cs | 10 +---------
1 file changed, 1 insertion(+), 9 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cordova-plugin-contacts/blob/72e97f30/src/wp/Contacts.cs
----------------------------------------------------------------------
diff --git a/src/wp/Contacts.cs b/src/wp/Contacts.cs
index 8d35011..50e4e08 100644
--- a/src/wp/Contacts.cs
+++ b/src/wp/Contacts.cs
@@ -677,17 +677,9 @@ namespace WPCordovaClassLib.Cordova.Commands
//Debug.WriteLine("jsonContact = " + jsonContact);
// JSON requires new line characters be escaped
- return "{" + jsonContact + "}";
- }
- private static string EscapeJson(string str)
- {
- if (String.IsNullOrEmpty(str))
- {
- return str;
- }
+ return "{" + jsonContact.Replace("\n", "\\n").Replace("\r","") + "}";
- return str.Replace("\n", "\\n").Replace("\r", "\\r").Replace("\t", "\\t").Replace("\"", "\\\"").Replace("&", "\\&");
}
}
}