On Thursday, May 10, 2012 10:30:10 AM UTC+2, sri wrote:
> just Mojo::JSON seems to have a problem.
Not a bug, templates work with characters and encoded JSON is bytes.
ok, but what do i have to write when i want to embed an utf8 containing json-string in an html template?
changing my example to...
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
use Mojo::ByteStream qw(b);
...
$self->stash( test => b(Mojo::JSON->new->encode($test)));
...
__DATA__
@@test.html.ep
<%= $test %>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
does not work neither
xolo :-(