From 738f4daed7f0555f7ac11dc2f527bc53dddd4e5b Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Fri, 1 Feb 2019 22:12:52 +0000 Subject: viewvcs: cleanup utf8 handling Favor in-place utf8::decode since it's a bit faster without method dispatch overhead; and don't care about validity just yet. HlMod->do_hl itself should return "utf8" strings, since other parts of our code can use it, so it's not the job of ViewVCS to post-process HlMod output. --- t/hl_mod.t | 1 + 1 file changed, 1 insertion(+) (limited to 't') diff --git a/t/hl_mod.t b/t/hl_mod.t index 80f88907..c402f1f7 100644 --- a/t/hl_mod.t +++ b/t/hl_mod.t @@ -19,6 +19,7 @@ my $orig = $str; { my $ref = $hls->do_hl(\$str, 'foo.perl'); is(ref($ref), 'SCALAR', 'got a scalar reference back'); + ok(utf8::valid($$ref), 'resulting string is utf8::valid'); like($$ref, qr/I can see you!/, 'we can see ourselves in output'); like($$ref, qr/&&/, 'escaped'); -- cgit v1.2.3-24-ge0c7