Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: num_in_chars incremented after each mbrtowc()

Sorry, I'm still not following; it still seems to indicate you don't
understand the function (which could well be my fault, which is why I've
improved the documentation).  Consequently, as I asked, what I need to
know is what output you expect from the function under what

(I do not need a patch and the following is without reference to the
innards of the function.)

Under what circumstances is what you are getting wrong?  You imply it is
to do with invalid characters (of some sort).  What (this is the key
question) do you expect to be returned for invalid characters?
Preferably with an example (text not video).  Also, is your issue
restricted to the question of width, or does it also apply to when the
function is returning a charater count (I'm guessing it's just widths?)

E.g.: I pass in the arguments ...  for the function and I expect this to
cause return ... so that the final output looks like ...

(What you say would be consistent, for example, with the fact that you
expect 2 to be returned for an octet from an invalid character because
the shell or something else happens to display the ones you've got as 2
characters.  That's certainly not designed into the function at the
moment and if that's what you want it's going to take a lot more work
because the width of display of invalid characters in the line editor
isn't fixed.  However, I'm not sure that the display you're talking
about is even in the line editor at all --- which means we're out of
luck because there is no fixed way of displaying invalid characters.
But I don't yet know this is the issue you're talking about.)


Messages sorted by: Reverse Date, Date, Thread, Author