title: Logging in WxPerl every other character is null
body: <p>I'm trying to write a small <a href="https://metacpan.org/module/Log%3a%3aAny%3a%3aAdapter" rel="nofollow">Log::Any::Adapter</a> for Wx logging, and for testing I'm using Wx's <a href="http://docs.wxwidgets.org/2.8.12/wx_wxlogstderr.html#wxlogstderr" rel="nofollow">LogStderr</a> class. My test fails, though, because the string printed to STDERR has every other character as a NULL. I figure that it's probably UTF-16le since I'm on Windows. I know I can do</p>
  
  <pre><code>decode('UTF-16le', $_)
  </code></pre>
  
  <p>but is there a way I can determine the encoding so the code works on all systems?</p>
  
  <p>My attempt:</p>
  
  <pre><code>use strict;
  use warnings;
  use Test::More tests =&gt; 1;
  use Wx;
  use Capture::Tiny qw(capture_stderr);
  use Encode::Locale;
  use Encode qw(decode);
  Wx::Log::SetActiveTarget(Wx::LogStderr-&gt;new());
  my $stderr = capture_stderr { Wx::LogMessage('hello!') };
  $stderr = decode(console_in =&gt; $stderr); #doesn't work; still has NUL's
  like($stderr, qr/hello!/, 'Wx logs correctly to STDERR');
  </code></pre>
  
  <p>I'd paste the output, but with all of the NULs I can't get it to copy onto my clipboard!</p>