Re: Bug: UTF-8 expansion results in extra characters

2017-03-06 Thread L A Walsh



Eduardo Bustamante wrote:

On Mon, Mar 6, 2017 at 6:50 AM, L A Walsh  wrote:
[...]
  

echo 'あa a '|wc -m
6

There should only be 5 characters.


use echo -n then.

$ echo -n 'あa a '|wc -m
5
  

---
   Yup.  I'm an idiot at times! 


The thing was that I kept copying it into different windows
and I kept getting different behaviors where the count wasn't
consistent.  So, I got overfocussed on reproducing it
otherwise.

   It's still the case that in Misaki's post, there is a space
at the end of the line, but not in the quoted version that Chet
posted...

   Thanks for the head-butt.

   Now if you can tell me what's wrong with my completion
problem, I can go back to sleep... ;^/  *sigh*




Re: Bug: UTF-8 expansion results in extra characters

2017-03-06 Thread Eduardo Bustamante
On Mon, Mar 6, 2017 at 6:50 AM, L A Walsh  wrote:
[...]
> echo 'あa a '|wc -m
> 6
>
> There should only be 5 characters.
use echo -n then.

$ echo -n 'あa a '|wc -m
5



Bug: UTF-8 expansion results in extra characters

2017-03-06 Thread L A Walsh

I didn't see that this was caught and wasn't sure if
it was already covered in what I previously
posted this problem in a follow-up to a similar problem.

It may be the same bug, but I wasn't sure. 


If I past the text in quotes into bash, bash tosses in
an extra character as evidenced by 'wc':


echo 'あa a '|wc -m
6

There should only be 5 characters.

If I cut/paste her text (in quotes) directly into 'wc -m' (so it
doesn't go through bash, but is taken directly from 'wc' on its
stdin), then I get '7' (2 extra chars for the quotes):


 wc -m

'あa a '7
  ^^ pressed Ctl-D twice to not end line w/another char (like LF).

Maybe that examples allows you to duplicate the problem?



I don't think your development setup allows for cut/paste
from an editor or mail-window that accurately copies the
characters.   Something in your text display+copy+insert
doesn't seem to copy the actual characters, but something
that looks similar.

Ex, copying text like this sometimes misses a space on the end:

あa a 


and

Copying from an editor or line that has 'tabs' in it, doesn't
seem to preserve the tabs, so you can't cut+paste script from
an editor into bash without it being becoming disintegrous.

I think its a side-effect of the development tools you are
using (I don't know what they are, but its also a guess, based
on sparse data where specific characters aren't mapped the same
and don't produce the same output in regards to what was
actually presented when someone tries to describe a problem.

It doesn't make a difference in most cases, but in a few, like
the ones mentioned above ;-(

Anyway, like I was trying to say, it's a, perhaps, inaccurate
deduction based scant evidence...  oh well...