Re: [PATCH 0/3] use UTF-8 encoding

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

 



On Fri, 24 Apr 2009, Clemens Ladisch wrote:

> That one is the only caller of usb_string() in the kernel that uses a
> buffer larger than 64 bytes, so I didn't bother about the others.
> 
> > 	Translation from UTF-16LE to latin-1 is easy.  Translation
> > 	to UTF-8 is harder because it requires you to check for
> > 	invalid code points.  Furthermore, if you write your own code
> > 	to do the translation then you are almost certainly duplicating 
> > 	code that already exists somewhere else in the kernel, which is 
> > 	a bad idea.
> 
> The only existing code I've found is utf8_wcstombs(), and it doesn't
> bother about invalid code points.
> 
> I've included the NLS patches here because there doesn't seem to be an
> NLS maintainer, and you wouldn't want to use the USB patch without those
> fixes.

As long as we're talking about changing the NLS code, we might as well
fix it up to handle invalid sequences.  I'll look into that; your USB
changes are good.

> Not much tested, because I don't have a USB device with non-ASCII
> strings.  And I'm not quite sure how applications will handle the
> encoding change ...

I don't have a USB device like that either, although it shouldn't be 
too hard to modify a gadget driver.  And as for applications, who 
knows?

Alan Stern

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux