title: string special characters into json stringify illegal token
body: <p>I'm trying to add a string inside a JSON object...</p>
  
  <pre><code>// this var can have special characters like [], commas, quotes, double quotes, accents, colon, semicolon, question marks, and maybe some other characters... Example*
  var textArticle = "Le Lorem Ipsum; est simplement. Du [faux] texte, employé: dans la composition, et la mise? En pagão avant impression!";
  
  // this var I'll get from a date object
  var hourArticle = "18:20";
  
  JSON.stringify({ "hour": hourArticle }),
  </code></pre>
  
  <p>When I only have hour inside the json, it works fine, I can use:</p>
  
  <pre><code>var hourFinal = JSON.parse(json).hour;
  </code></pre>
  
  <p>But when I add another entry with the value of textArticle, I get "Uncaught SyntaxError: Unexpected token ILLEGAL" for any token I try to with JSON.parse, example:</p>
  
  <pre><code>JSON.stringify({ "text": textArticle, "hour": hourArticle }),
  var textFinal = JSON.parse(json).text;
  Error Uncaught SyntaxError: Unexpected token ILLEGAL
  </code></pre>
  
  <p>What is wrong? I appreciate any help!
  Thank you</p>
  
  <p><strong>Update #1:</strong> 
  I'm creating a web app with cordova and jquery mobile... The json object is for a local notification plugin: <a href="https://github.com/katzer/cordova-plugin-local-notifications/" rel="nofollow">Kazter Local Notification</a>... I've created the notification passing the json stringify, and on the onTrigger function from the plugin it returns the json object. But I got the illegal token when using JSON.parse(json)... 
  The plugin works like this</p>
  
  <pre><code>window.plugin.notification.local.add({
  message: mainText,
  json: JSON.stringify({ "text": textArticle, "hour": hourArticle }),
  title: 'Title 1'
  });
  </code></pre>
  
  <p>Thanks guys</p>
  
  <p><strong>Update #2:</strong>
  Ok guys, I found out what was happening, there whas nothing to do with the plugin or cordova, or anything... the value of textArticle var its a random line from a text file.. Like this:</p>
  
  <pre><code>var filePath = "txt/datatexts.txt";
  xmlhttp = new XMLHttpRequest();
  xmlhttp.open("GET",filePath,false);
  xmlhttp.send(null); 
  var fileContent = xmlhttp.responseText;
  var fileArray = fileContent.split('\n')
  var randLineNum = Math.floor(Math.random() * fileArray.length);
  var textRandom = fileArray[randLineNum];
  var textRandomParts = textRandom.split('#');   
  var textArticleFull = textRandomParts[0] + " " + textRandomParts[1] + " " + textRandomParts[2];
  var textArticle = textArticleFull;
  </code></pre>
  
  <p>But resolving the textArticle value, it output something like:</p>
  
  <pre><code>var textArticle = "Le Lorem Ipsum; est simplement. Du [faux] texte, employé: dans la composition, et la mise? En pagão avant impression!\r";
  </code></pre>
  
  <p>I don't know why but it put a '\r' at the end of the value..
  And then it throws the illegal token..
  So all I had to do is:</p>
  
  <pre><code>var textArticleOK = textArticle.replace("\r", "");
  json = JSON.stringify({ "text": textArticleOK, "hora": hourArticle});
  var textArticleParse = JSON.parse(json).text;
  </code></pre>
  
  <p>Well...Thats it... There is something I should know?
  I just don't know why this happens, as the '\r' is inside the double quotes.... And I'm spliting the text file by line with '\n'.
  Also this is how my text file looks like:</p>
  
  <ol>
  <li>text part1#text part2#text part3</li>
  <li>text part1#text part2#text part3</li>
  <li>text part1#text part2#text part3</li>
  </ol>
  
  <p>It doesn't have the '\n' at the end of each line, do I have to add that?</p>
  
  <p>Thanks a lot!</p>