Special characters not allowed in the Headers

Special characters not allowed in the Headers

bmarottabmarotta Posts: 1Questions: 0Answers: 0
edited November 2011 in Bug reports
Hi,

if you want to use special characters in the localization, it doesn't work. An easy solution is to call the unescape in the _fnMap function:

Example (german localization)

[code]
{
"sProcessing": "Bitte warten...",
"sLengthMenu": "_MENU_ Eintr%E4ge anzeigen",
"sZeroRecords": "Keine Eintr%E4ge vorhanden.",
"sInfo": "_START_ bis _END_ von _TOTAL_ Eintr%E4gen",
"sInfoEmpty": "0 bis 0 von 0 Eintr%E4gen",
"sInfoFiltered": "(gefiltert von _MAX_ Eintr%E4gen)",
"sInfoPostFix": "",
"sSearch": "Suchen",
"oPaginate": {
"sFirst": "Erster",
"sPrevious": "Zur%FCck",
"sNext": "N%E4chster",
"sLast": "Letzter"
}
}
[/code]

[code]
function _fnMap( oRet, oSrc, sName, sMappedName )
{
if ( typeof sMappedName == 'undefined' )
{
sMappedName = sName;
}
if ( typeof oSrc[sName] != 'undefined' )
{
oRet[sMappedName] = oSrc[sName];

// If it is a string, we call the unescape function
if (oRet[sMappedName] != null && oRet[sMappedName].substring)
oRet[sMappedName] = unescape(oRet[sMappedName]);
}
}
[/code]

Replies

  • allanallan Posts: 63,689Questions: 1Answers: 10,500 Site admin
    What do you mean by special characters? Anything that is not ASCII? If that's the case you just need to make sure your page is using UTF8 and the Javascript is flagged as such. For example all the localisation translations should work just fine with UTF8 characters: http://datatables.net/plug-ins/i18n#Hindi

    Allan
This discussion has been closed.