List Info

Thread: Re: wxInputStream and multibyte character sets




Re: wxInputStream and multibyte character sets
country flaguser name
United Kingdom
2007-06-20 22:01:22
Hi,

It doesn't work as I expected on Win32. (but I might be
expecting the wrong thing).

Where in the READLINE routine you do:

 if( c == 'n' ) break;
 ++off;


I think you need

++off;
if( c == 'n' ) break;

 
This, at least, makes it work for me.

The way I read the code, currently the 'n' byte never gets
returned which I assume is not what is intended.

It works fine on my Linux box as it stands. So I suppose
that if the byte 'n' is stripped off, the final byte in the
stream that gets returned is always 'null' - which on Linux
gets treated as end of string somewhere along the line, but
on Win32 doesn't.  


Regards

Mark


Mattia Barbon wrote:
> On Tue, 19 Jun 2007 21:39:29 +0100
> Mark Dootson <mark.dootsonznix.com> wrote:
> 
>> Mattia Barbon wrote:
>>>   I do not agree with what you write above
(note: I am not saying the current implementation is
correct!)
>>> what I think readline should do is work with
bytes: 
>>>
>>>  read a char from the stream
>>>  add it to a charbuffer
>>>  if char == 'n' {
>>>      return the buffer as a byte string,
without performing any conversion
>>>  }
>>>
>>>   I believe that automatically interpreting
program output based upon
>>> wxWidgets ideas (which usually means using the
current locale) will cause
>>> trouble.  Returning bytes leaves the
interpretation to the calling program
>>> which is always a safe choice.
>> I think you are right. Bytes makes much more
sense.
> 
>   Changed in Subversion.  I tried it with
Wx::Perl::ProcessStream 0.09
> and it works as I expect.  Pleas let me know if it
works for you too.
> 
> Regards,
> Mattia



------------------------------------------------------------
-------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and
take
control of your XML. No limits. Just data. Click to get it
now.
http://sourcefor
ge.net/powerbar/db2/
_______________________________________________
wxperl-users mailing list
wxperl-userslists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wxperl-use
rs

[1]

about | contact  Other archives ( Real Estate discussion Medical topics )