erlydtl/erlydtl — pull request #113 by tomekowal (2013-12-27 14:30:17+00:00)
Title: Make escapejs work with 'line separator' 8232 and 'paragraph separator' ...

Line separator character is represented as a binary in following way:
```erlang
<<226,128,168>>
binary_to_list(<<226,128,168>>) = [226,128,168],
```

To properly handle line separator and paragraph separator,
escapejs requires list of characters, which contains integer 8082.
```erlang
unicode:characters_to_list(<<226,128,168>>) = [8082].
```

This patch uses `unicode:character_to_list/1` to make line separator one character.

Another way to fix problem with line separator is
adding another two clauses to `escapejs/2`
```erlang
escapejs([226, 128, 168 | Rest], Acc) -> ...
escapejs([226, 128, 169 | Rest], Acc) -> ...
```

but using `unicode:characters_to_list/1` is simpler and does the job.