Special characters not allowed in the Headers
Special characters not allowed in the Headers

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]
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]
This discussion has been closed.
Replies
Allan