aboutsummaryrefslogtreecommitdiffstats
path: root/lib/LXRng/Web.pm
diff options
context:
space:
mode:
Diffstat (limited to 'lib/LXRng/Web.pm')
-rw-r--r--lib/LXRng/Web.pm9
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/LXRng/Web.pm b/lib/LXRng/Web.pm
index 9e9e24a..5b11a2d 100644
--- a/lib/LXRng/Web.pm
+++ b/lib/LXRng/Web.pm
@@ -132,6 +132,15 @@ sub print_markedup_file {
my $handle = $node->handle();
LXRng::Lang->init($context);
+ my $index = $context->config->{'index'};
+ my $charset = $index->get_file_charset($context->tree, $node->name,
+ $context->release);
+ $charset ||= 'ascii';
+
+ binmode($handle, ":encoding($charset)");
+ binmode(STDOUT, ":encoding(utf-8)");
+ binmode($cache, ":encoding(utf-8)") if $cache;
+
my $lang = LXRng::Lang->new($node);
my $parse = LXRng::Parse::Simple->new($handle, 8,
@{$lang->parsespec});