[Patch] multibyte encodings in strings

m4tze@exitno.de m4tze@exitno.de
Tue Nov 13 19:46:00 GMT 2018
Hi Nick,

> > Could you please run
> > 
> >     echo "aa53007400720069006e0067003100aa53007400720069006e0067003200bb" | xxd -p -r | ./strings -el | xxd
> > 
> > to check if an additional character gets printed after "String1"
> 
> If by "additional" you mean a period character then yes:
> 
>   00000000: 5374 7269 6e67 310a 5374 7269 6e67 320a  String1.String2.

As the period is just a placeholder for the newline (0x0a) the output would be

String1
String2

Which is correct.
 
> >     echo "aa53007400720069006e00670031000053007400720069006e0067003200bb" | xxd -p -r | ./strings -el
> 
> Gives:
> 
> String1
> String2
> 
> >     echo "aa53007400720069006e0067003100aabbcc53007400720069006e0067003200bb" | xxd -p -r | ./strings -el
> 
> Gives the same:
> 
> String1
> String2

All commands should give

String1
String2

So to me it looks like everything works just fine. If you can reproduce the
conditions where the output is "String1" and "tring2" please let me know.
Otherwise it should be ok to change the testcase to expect "String1" and
"String2"

Thanks a lot
Mathias



More information about the Binutils mailing list