From 54e801776d003d28a890009335c822a990140f34 Mon Sep 17 00:00:00 2001 From: Bjorn Neergaard Date: Sun, 27 Dec 2015 15:45:48 -0600 Subject: [PATCH 1/2] Revert "Make JSON.stringify encode numbers properly" This reverts commit f4600644ecbfd333995a1d43be06b5bcefce1e70. --- code/modules/json/json.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/modules/json/json.dm b/code/modules/json/json.dm index dc48926021c..d3b80d6792d 100644 --- a/code/modules/json/json.dm +++ b/code/modules/json/json.dm @@ -12,7 +12,7 @@ /datum/jsonHelper/proc/WriteValue(list/json, value) . = json if(isnum(value)) - json += num2text(value, 20) + json += value // Consider num2text(value, 20) for maximum accuracy. else if(isnull(value)) json += "null" else if(istext(value)) From 65a2c509087fb2ca61b5de373992a33d94df7ab7 Mon Sep 17 00:00:00 2001 From: Bjorn Neergaard Date: Sun, 27 Dec 2015 15:49:38 -0600 Subject: [PATCH 2/2] Properly encode NanoUI JSON... This is right, not the last fix. The '+' in BYOND scientific notation was becoming a space. --- code/modules/nano/nanoui.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/modules/nano/nanoui.dm b/code/modules/nano/nanoui.dm index c713e14bb45..652bd9ad146 100644 --- a/code/modules/nano/nanoui.dm +++ b/code/modules/nano/nanoui.dm @@ -314,7 +314,7 @@ var/list/send_data = get_send_data(data) // Get the data to send. // Send the new data to the recieveUpdate() Javascript function. - user << output(JSON.stringify(send_data), "[window_id].browser:receiveUpdate") + user << output(url_encode(JSON.stringify(send_data)), "[window_id].browser:receiveUpdate") /**