Re: [Bugme-new] [Bug 8310] New: USB device names are not sanitized for UTF-8

David Brownell <[email protected]>
Newsgroups gmane.linux.usb.devel
Message-ID <[email protected]>
On Monday 04 June 2007, Pete Zaitcev wrote:
> On Mon, 4 Jun 2007 16:52:01 -0400 (EDT), Alan Stern <[email protected]> wrote:

> > Does anybody think it would be worthwhile to convert string descriptors 
> > from UCS-16 to UTF-8 (instead of Latin1) when we read them in?

Or even UTF-7 ... ?   FWIW the input isn't UCS-16; it's UTF16-LE.

Back when I did the UTF16-LE to ISO Latin/1 conversion, Linux
distros were doing well to get even that far beyond ASCII.  ;)
It's good that seems to have changed.


> I remember that issue. I thought that we wanted some kind of escape
> syntax... Like what HTML uses with &#xxxx; perhaps. This would allow
> to edit xorg.conf on systems which are not UTF-8 clean. But perhaps
> it's a non-goal. How big is the code to convert (we need both ways,
> right)?

How big?  Not big.  UTF-16 to UTF-8 is a simple algorithm.  For
the reverse, see drivers/usb/gadget/usbstring.c ... the trick is
you'd need to know enough Unicode to not goof it.  Or, to find
some code that does it right.

- Dave


-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
[email protected]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.