qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PULL 1/2] usb-mtp: fix utf16_to_str


From: Eric Blake
Subject: Re: [Qemu-devel] [PULL 1/2] usb-mtp: fix utf16_to_str
Date: Mon, 3 Dec 2018 14:00:19 -0600
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.3.1

On 12/3/18 1:50 PM, Gerd Hoffmann wrote:
Make utf16_to_str return an allocated string.  Remove the assumtion that

s/assumtion/assumption/ (but probably too late to worry about commit typos in a pull request :)

the number of string bytes equals the number of utf16 chars (which is
only true for ascii chars).  Instead call wcstombs twice, once to figure
the storage size and once for the actual conversion (as suggested by the
wcstombs manpage).

FIXME: surrogate pairs are not working correctly.  Pre-existing bug,
fixing that is left for another day.

--
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3266
Virtualization:  qemu.org | libvirt.org



reply via email to

[Prev in Thread] Current Thread [Next in Thread]