use Data::Dump qw(dump);
use File::Slurp;
use JSON;
+use Encode;
sub index {
my $self = shift;
die "$path $!" unless -r $path;
# we could use Mojo::JSON here, but it's too slow
- $data = from_json read_file $path;
+# $data = from_json read_file $path;
+ $data = read_file $path;
+ Encode::_utf8_on($data);
+ warn "# json snippet: ", substr($data,0,200);
+ $data = from_json $data;
foreach my $e ( @{ $data->{items} } ) {
foreach my $n ( keys %$e ) {
<!doctype html><html>
- <head><title>Welcome</title></head>
- <body>
+<head>
+<meta charset=utf-8>
+<title>Mojo Facets <%= session 'title' %></title>
+</head>
+<body>
<a href="<%= url_for( action => 'index' ) %>">load</a>
<a href="<%= url_for( action => 'columns' ) %>">columns</a>
<%== content %>
- </body>
+</body>
</html>