This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [Patch] multibyte encodings in strings
- From: m4tze at exitno dot de
- To: Nick Clifton <nickc at redhat dot com>, binutils at sourceware dot org
- Date: Tue, 13 Nov 2018 10:38:55 +0000
- Subject: Re: [Patch] multibyte encodings in strings
- References: <20181030110408.GA3348@exitno.de> <e7a9b342-166c-ed63-8184-62756bafba05@redhat.com>
Hi Nick,
> I have applied the patch along with a couple of extra updates.
> Specifically I have created a ChangeLog entry for the patch, and a
> new test in the binutils testsuite in order to make sure that the
> patch continues to work.
Thanks.
> There is one issue however that I would like to check with you.
> The original (unpatched) decoding of the test binary that you
> supplied produces the output: "String2" whereas the patched
> version of string produces: "String1" and "tring2". Is this
> correct ? I was kind of expecting the output to be "String1"
> and "String2".
Yes the output should be "String1" and "String2". As I am getting the expected
output on all my systems it is difficult for me to guess what is going wrong.
It looks as if your system accepts "aa53" as a printable utf-16-le char.
Could you please run
echo "aa53007400720069006e0067003100aa53007400720069006e0067003200bb" | xxd -p -r | ./strings -el | xxd
to check if an additional character gets printed after "String1" and run
echo "aa53007400720069006e00670031000053007400720069006e0067003200bb" | xxd -p -r | ./strings -el
echo "aa53007400720069006e0067003100aabbcc53007400720069006e0067003200bb" | xxd -p -r | ./strings -el
to check if these yield the expected results?
Kind regards
Mathias