When i tried to get data from a UTF-8 encoded database with ajax in json-format and the data contains special characters like Ä,Ö,Ü,ä,ö,ü,... then the result set is empty!
$('.club-details').click(function() {
var element = $(this);
var data = {
gid: $(this).parent().parent().parent().parent().data('gid'),
club_number: $(this).parent().parent().data('club')
};
$.ajax({
type: 'POST',
url: TRANSFER_CALLS_URI,
data: 'key=getClubDetails&data=' + JSON.stringify(data),
dataType: 'json',
success: function(response) {
var html = "";
html += "<table>";
html += " <tr>";
html += " <td>Name kurz</td>";
html += " <td>" + response[0].name_short + "</td>";
html += " </tr>";
html += " <tr>";
html += " <td>Schießstätte</td>";
html += " <td>" + response[0].location + "</td>";
html += " </tr>";
html += " <tr>";
html += " <td>Telefon</td>";
html += " <td>" + response[0].phone + "</td>";
html += " </tr>";
html += "</table>";
element.unbind('click').popover({
content: html,
title: 'Vereinsinformation',
html: true,
placement: 'bottom'
}).popover('show');
},
error: function() {
$.error('Ajax');
}
});
});
Data records without german special characters will be successfully received and displayed.