Skip to content

Commit

Permalink
Merge pull request #6 from qluan/master
Browse files Browse the repository at this point in the history
[Fix] json字符串支持\n\n\u4f60
  • Loading branch information
qluan authored Nov 1, 2016
2 parents 6ef6234 + 7b3a80f commit bbbd2c3
Showing 1 changed file with 1 addition and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -331,6 +331,7 @@ public void callFunction(String functionName, String jsonString) {
mCore.loadUrl(String.format(Constants.FUNC_FORMAT, functionName));
} else {
jsonString = jsonString.replaceAll("(\\\\)([^utrn])", "\\\\\\\\$1$2");
jsonString = jsonString.replaceAll("(\\\\)([utrn])", "\\\\$1$2");
jsonString = jsonString.replaceAll("(?<=[^\\\\])(\")", "\\\\\"");
mCore.loadUrl(String.format(Constants.FUNC_FORMAT_WITH_PARAMETERS, functionName, jsonString));
}
Expand Down

0 comments on commit bbbd2c3

Please sign in to comment.