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

Re: [Xen-devel] [PATCH] VHD: Fix locale aware character encoding handling



On Sun, 2015-03-08 at 11:54 +0100, Philipp Hahn wrote:
> ASCII is 7 bit only, which does not work in UTF-8 environments:
> > failed to read parent name
> 
> Setup locale in vhd-util to parse LC_CTYPE and use the right codeset
> when doing file name encoding and decoding.
> 
> Increase allocation for UTF-8 buffer as one UTF-16 character might use
> twice as much space in UTF-8 (or more).
> 
> Don't check outbytesleft==0 as one UTF-8 characters get encoded into
> 1..8 bytes, so it's perfectly fine (and expected) for the output to have
> remaining bytes left.
> 
> Test-case:
> $ ./vhd-util create -n Ã.vhd -s 1
> $ ./vhd-util snapshot -n snap.vhd -p Ã.vhd ; echo $?
> 
> See
> <http://unix.stackexchange.com/questions/48689/effect-of-lang-on-terminal>
> for more information about the details of handling the encoding right.
> 
> Signed-off-by: Philipp Hahn <hahn@xxxxxxxxxxxxx>

I'm a bit perplexed over why libvhd is even trying to interpret these
bytes, I probably don't want to know...

Anyway: acked + applied, thanks.



_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.