ffi-test.js
//
// json_text: json string using "HTTP.query();" from API server like below.
//
let json_text = '{\x0a "ip": "122.47.26.50",\x0a "city": "Sogongdong",\x0a "region": "Seoul-t'ukpyolsi",\x0a "country": "KR",\x0a "loc": "37.5645,126.9750",\x0a "org": "AS17858 LG POWERCOMM"\x0a}';
json_text = replace(json_text, '\x0a','' ); // replace all '\x0a' with '' in json_text string.
json_text = replace(json_text, '\\"', '"'); // replace all '\\"' with '"' in json_text string.
json_text = replace(json_text, '\\n',''); // replace all '\\n' with '' in json_text string.
ffi-test.js.output.log
replace():
"{\n \"ip\": \"122.47.26.50\",\n \"city\": \"Sogongdong\",\n \"region\": \"Seoul-t'ukpyolsi\",\n \"country\": \"KR\",\n \"loc\": \"37.5645,126.9750\",\n \"org\": \"AS17858 LG POWERCOMM\"\n}"
replace():
"{\n "ip": "122.47.26.50",\n "city": "Sogongdong",\n "region": "Seoul-t'ukpyolsi",\n "country": "KR",\n "loc": "37.5645,126.9750",\n "org": "AS17858 LG POWERCOMM"\n}"
replace():
"{ "ip": "122.47.26.50", "city": "Sogongdong", "region": "Seoul-t'ukpyolsi", "country": "KR", "loc": "37.5645,126.9750", "org": "AS17858 LG POWERCOMM"}"
ffi.cpp
/*
** FFI.cpp
** Description: Implement such missing function as below on mJS on Mongoose OS.
** Author: Jaehong Park (binizcode)
**
*/
#include "ffi.h"
#include "string.h"
#include "stdlib.h"
This file has been truncated. show original
There are more than three files. show original