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

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

 



On Thu, Apr 13, 2017 at 10:29:13AM +0200, Victor Toso wrote:
> Hi,
> 
> On Wed, Apr 12, 2017 at 04:19:06PM +0200, Christophe Fergeau wrote:
> > 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.
> 
> If we enforce utf-8 that would means converting twice, iso8859-1 to
> utf-8 for the protocol and utf-8 to is8859-1 in the guest.

Ah, I did not mention that I was assuming no changes in the agents.

Note that I would not assume that we can know in general the encoding of
a non-UTF-8 filename, it's usually going to be the same encoding as the
one used system-wide, but if you start adding USB disks to the mix
moving between systems using different legacy encodings, this is no
longer true. Take for example a FAT-formatted USB key with japanese
filenames, plug it into your English Windows, I believe you cannot know
which encoding the filename is in, so your "iso8859-1" example above
generally means "byte array with unknown encoding", which is what we've
got now..

> All in all, having a weird filename is not a major problem IMHO; The
> main problem is not having the file transferred at all. I guess the
> windows agent need some work to avoid that in the future.
> 
> This is just a proposal for something more consistent... I'm totally
> fine to fix this a regression by 'reverting' the change to use
> g_file_get_basename(), I'll send a v2 with that soon.

Yup, fully agree about the problem to solve, and that what you suggest
should solve it. Alternatively g_file_info_get_attribute_byte_string()
which was suggested before in the thread should do the job too.

Christophe

Attachment: signature.asc
Description: PGP signature

_______________________________________________
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]