c++ - Using javascript objects with UTF-16 property names -
c++ - Using javascript objects with UTF-16 property names -
i'm calling service returns utf-16 json data. question if json object has utf-16 strings property names there simple way reference these properties?
for example, here how response info looks after calling json.stringify on it:
"{"c\u0000o\u0000n\u0000t\u0000e\u0000n\u0000t\u0000s\u0000":{ ...
in code i'd data['contents']
. there simple way around avoids either hardcoding strings unicode escape sequences?
update: changed indicate strings utf-16.
here's illustration (visual c++) of phone call generate json output:
wchar_t* str = _t("contents"); yajl_gen_string(g, (unsigned char*)str, wcslen(str) * sizeof(tchar));
javascript c++ ajax utf-8 yajl
Comments
Post a Comment