Re: [spice-gtk v1] file-xfer: Fix bad filename encoding

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

 



> 
> On Wed, Apr 12, 2017 at 03:55:04PM +0200, Victor Toso wrote:
> > I'm not specialist on possible problems but although ascii is compatible
> > with utf8 it might become a problem to not have a standard well defined
> > in the future although Marc-André said it should be UTF-8.
> 
> If you mandate UTF-8 in the protocol, you probably cause a regression if
> your client has an iso8859-1 filename, and you dnd that to a VM where
> you also expect the iso8859-1 filename. In this day and age, this is
> just a corner case, but I'm not sure mandating UTF8 conversion of
> filenames before dnd'ing them is not going to cause issue either.
> 
> Christophe
> 

That's why another alternative I wrote was to get the _byte_string of
normal name.
Note however that passing the binary is not possible on Windows
as utf16 is a completely different beast (maybe glib does already
some transformation at least to make it C compatible).
Yes, invalid encoding is the same stuff that worry me, on the
other hand current code seems broken with the utf8 which is the
default on most Unix now.
Passing byte stream + encoding is more flexible as allows to
pass invalid data which could be attempted to be handled better
(whatever better means passing invalid data... on Unix -> Unix
you can duplicate the bytes ignoring the encoding).
I cannot find a single easy way to support all cases, I could try
with
- Windows: pass utf8 conversion from wide name (no sense to use
  ANSI one);
- Unix: pass binary format.
In this case Windows could receive invalid no utf-8 names which
should deal in some way... assuming iso8859-1 for invalid characters
could be a solution.

Frediano
_______________________________________________
Spice-devel mailing list
Spice-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/spice-devel




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]     [Monitors]