We have found that angular-sanitize "sanitizes" the Nordic alphabet's characters and makes them into HTML entities. So every time you input ä character in INPUT and $sanitize your input, you end up with sanitized string that gets these characters replaced by something else (ä ;), which corrupts the input, as later I'd like display that string or send it to server. And it appears that user entered "ä" not "ä". We work in UTF8 as usual, so we do not need this.
Presently we have a solution workaround like this (app is our angular application):
app.config(function($provide){
// Prevent $sanitize from converting nordic special characters (ö, ä, å) into HTML entities
// ----------------------------------------------------------------------------------------
// We don't have need for sanitizing umlauts.
$provide.decorator("$sanitize", function($delegate, $log){
return function(text, target){
var result = $delegate(text, target);
result = result
.replace(/ä|ä/g, 'ä')
.replace(/Ä|Ä/g, 'Ä')
.replace(/ö|ö/g, 'ö')
.replace(/Ö|Ö/g, 'Ö')
.replace(/å|å/g, 'å')
.replace(/Å|Å/g, 'Å');
return result;
};
});
});
However I suspect that there might be a nicer way to achieve this by telling $sanitize some options. I appreciate suggestions how to do it better way.