Skip to content

Commit

Permalink
Fix accented characters displaying wrong.
Browse files Browse the repository at this point in the history
  • Loading branch information
nldn committed Jan 29, 2020
1 parent 243e5a9 commit c39e773
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions widget/controllers/widget.event.controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,7 @@
}
if (event.data.description) {
eventDescr = event.data.description.replace(/<[^>]*>?/g, ''); //dépouiller les caractères spéciaux
eventDescr = decodeHtmlCharCodes(eventDescr);
} else {
eventDescr = "";
}
Expand All @@ -188,6 +189,13 @@
}
}
}

function decodeHtmlCharCodes(str) {
return str.replace(/(&#(\d+);)/g, function(match, capture, charCode) {
return String.fromCharCode(charCode);
});
};

buildfire.device.calendar.addEvent(
{
title: eventTitle
Expand Down

0 comments on commit c39e773

Please sign in to comment.