Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

changed unicode:characters_to_list back to binary_to_list #15

Merged
merged 2 commits into from

2 participants

@cstar

Hi Evan,

694fc92 would break my templates (with a ™ in them) with
[{erlang,iolist_to_binary,[...SNIP...]
{webmachine_decision_core,encode_body,1},
{webmachine_decision_core,decision,1},
{webmachine_decision_core,handle_request,2},
{webmachine_mochiweb,loop,1},
{mochiweb_http,headers,5},
{proc_lib,init_p_do_apply,3}]

I've tracked down the problem to unicode:characters_to_list. Put it back to binary_to_list, and it worked again.
Also added is an additional test, just to actually make sure I'm fixing something.

This fix is certainly not the best one, but it does fix my problem.

Cheers,

@evanmiller
Owner

Thanks. One day it would be nice to do string encodings right, but for now I'll revert to the old behavior.

@evanmiller evanmiller merged commit d3a953f into from
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Jun 29, 2011
  1. @cstar
  2. @cstar

    Test with extended character

    cstar authored
This page is out of date. Refresh to see the latest.
Showing with 5 additions and 1 deletion.
  1. +1 −1  src/erlydtl_compiler.erl
  2. +4 −0 tests/src/erlydtl_unittests.erl
View
2  src/erlydtl_compiler.erl
@@ -308,7 +308,7 @@ parse(CheckSum, Data, Context) ->
end.
parse(Data) ->
- case erlydtl_scanner:scan(unicode:characters_to_list(Data)) of
+ case erlydtl_scanner:scan(binary_to_list(Data)) of
{ok, Tokens} ->
erlydtl_parser:parse(Tokens);
Err ->
View
4 tests/src/erlydtl_unittests.erl
@@ -958,6 +958,10 @@ tests() ->
<<"{% with a=b %}{{ a }}{% endwith %}">>, [{b, "foo"}], <<"foo">>},
{"Cache multiple",
<<"{% with alpha=1 beta=b %}{{ alpha }}/{{ beta }}{% endwith %}">>, [{b, 2}], <<"1/2">>}
+ ]},
+ {"unicode", [
+ {"(tm) somewhere",
+ <<"">>, [], <<"">>}
]}
].
Something went wrong with that request. Please try again.