I am facing an issue where special characters are not being printed properly on my webpage.
So, I am making an ajax query, with python script at backend :
$.ajax({
url: BACK_END_LOC + 'get_search_results',
data: ({keyword1: keyword1,
keyword2: keyword2,
start_time: encodeURI(start_time),
end_time: encodeURI(end_time),
dataset: $("#dataset").val()
}),
success: function(data) {
response = eval('(' + data + ')');
if (response.error_code == 0) {
render_event_search_results(response.data);
} else {
alert('Error_code:' + response.error_code + ', Error_msg:' + response.error_msg);
}
},
Python is returning a json object:
def get_search_results(req, keyword1, keyword2, start_time, end_time, dataset):
s = keyword1 + "," + keyword2
# get filtered events
results = get_filtered_events(dataset, keyword1, keyword2, start_time, end_time)
try:
r = {'error_code': 0, 'error_msg': 'OK', 'data': results}
except Exception, e:
raise e
r = {'error_code': 1, 'error_msg': 'Oops'}
return simplejson.dumps(r)
Now, one field of this object has special characters. When I try to print this field on html "alert(gEvents[0].signature)", it is being printed as : \u0432\u0438\u0434\u0435\u043e_storm
How can I get it printed like :видео_storm, which is the actual text.