cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ste...@apache.org
Subject [23/28] git commit: CB-3035 Fix issue with windows new line char \n\r
Date Thu, 05 Dec 2013 00:56:59 GMT
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/master
Commit: 72e97f3078c1dc27aadb0d40efff192dc399bd66
Parents: 148774d
Author: Jesse MacFadyen <purplecabbage@gmail.com>
Authored: Mon Dec 2 14:02:15 2013 -0800
Committer: hermwong <herm.wong@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("&", "\\&");
         }
     }
 }


Mime
View raw message