Closed tandrewnichols closed 10 years ago
There aren't any known bugs with this. If you provide a test case, we can look into it.
Here are some special characters that we suspect are failing (the page fails to render, but hogan doesn't report which character, so it's hard to know which one is the problem if a page contains more than one unusual character): 

, '
, ’
, 
, and &
Usually, we get these when people have pasted text in from an external application (e.g. Word). They also, typically, tend to be spacing characters. 

is one we know for sure causes problems, and it's some sort of line break character. Since javascript can't handle multi line strings, it causes problems.
The line separator with hex code e280a8
is the problem (after some testing). The other characters listed above work fine once this one is removed.
Here's a work around we're using that works:
var str = JSON.stringify(template.data);
str = str.replace(/\u2028/g, '\\n').replace(/\u2029/g, '\\n');
template.data = JSON.parse(str);
We just fixed this in Issue #185. It's already in version 3.0.2
Ok, thanks.
Is it normal that Hulk will eat my Catégorie
in UTF-8 and spill out a Cat├®gorie
in UCS-2 LE BOM
or UTF-16
or whatever and my computer can't read it?
We've had trouble with some unusually utf8 characters causing parse failures. Would you consider using something like he to encode strings?