Re: [systemd-devel] [PATCH] shared: fix utf16_to_utf8() on big endian machines

2015-02-18 Thread Tom Gundersen
On Wed, Feb 18, 2015 at 3:19 PM, Martin Pitt wrote: > Martin Pitt [2015-02-18 15:06 +0100]: >> I couldn't quickly find a reference for EFI variables (which is the >> main thing we are using this for), and I don't have/know a big-endian >> EFI machine to check this on. > > I had a look into the off

Re: [systemd-devel] [PATCH] shared: fix utf16_to_utf8() on big endian machines

2015-02-18 Thread Martin Pitt
Martin Pitt [2015-02-18 15:06 +0100]: > I couldn't quickly find a reference for EFI variables (which is the > main thing we are using this for), and I don't have/know a big-endian > EFI machine to check this on. I had a look into the official spec http://www.uefi.org/sites/default/files/resources/

Re: [systemd-devel] [PATCH] shared: fix utf16_to_utf8() on big endian machines

2015-02-18 Thread Tom Gundersen
On Wed, Feb 18, 2015 at 3:06 PM, Martin Pitt wrote: > Hey Tom, > > Tom Gundersen [2015-02-18 14:34 +0100]: >> I think we want to assume that we only get UTF-16LE, so it looks like >> it is the test that is buggy. That's what we agreed, right Lennart? > > Ah, ok. Indeed GUID partition names are UTF

Re: [systemd-devel] [PATCH] shared: fix utf16_to_utf8() on big endian machines

2015-02-18 Thread Martin Pitt
Hey Tom, Tom Gundersen [2015-02-18 14:34 +0100]: > I think we want to assume that we only get UTF-16LE, so it looks like > it is the test that is buggy. That's what we agreed, right Lennart? Ah, ok. Indeed GUID partition names are UTF16LE. I couldn't quickly find a reference for EFI variables (w

Re: [systemd-devel] [PATCH] shared: fix utf16_to_utf8() on big endian machines

2015-02-18 Thread Tom Gundersen
On Wed, Feb 18, 2015 at 6:54 AM, Martin Pitt wrote: > 219 shows a test failure in test-utf8 on big-endian machines (on > Debian: powerpc, s390, mips): > > Assertion 'streq(a, utf8)' failed at src/test/test-utf8.c:103, function > test_utf16_to_utf8(). Aborting. > > gdb shows that indeed the conver

[systemd-devel] [PATCH] shared: fix utf16_to_utf8() on big endian machines

2015-02-17 Thread Martin Pitt
Hello all, 219 shows a test failure in test-utf8 on big-endian machines (on Debian: powerpc, s390, mips): Assertion 'streq(a, utf8)' failed at src/test/test-utf8.c:103, function test_utf16_to_utf8(). Aborting. gdb shows that indeed the converted string is utter bogus. a is the converted string,