From: Mattia B. <mat...@li...> - 2007-05-13 18:34:18
|
On Sat, 12 May 2007 16:40:05 +0100 Mark Dootson <mar...@zn...> wrote: Hi, > I have a problem with module Wx::Perl::ProcessStream. > This reads the STDOUT from an external process executed using Wx::Process= and Wx::ExecuteCommand. > This appears not to work if the output stream from the external process i= s, for example, UTF-8. I see. =20 > I *think* what perhaps should happen is >=20 > read a char from the stream > add it to a charbuffer > if char =3D=3D '\n' { > convert charbuffer to a wxString ( method determined by wxWidgets uni= code/ansi build macros ) > return wxString > } Seems reasonable. > I'm not sure if Wx::InputStream::READLINE needs changing or not. Any thou= ghts? I believe (at least) an option to do so would be a good idea. Adding an optional 'encoding' parameter is likely the best option. For a test case, = is #!/usr/bin/perl -w use Encode; print Encode::encode_utf8( "=E0\n" ); sleep 1; print Encode::encode_utf8( "=E0\n" ); sleep 1; print Encode::encode_utf8( "=E0\n" ); print Encode::encode_utf8( "=E0\n" ); a good enough test case? Regards. Mattia |