Duncan Sands wrote:
Hi Alan,


Just a couple of minor comments:

It's not really necessary to restrict yourself to printable Latin
characters (although it is safer).  After all, properly-formed string
descriptors may contain arbitrary UCS-16 characters.  You could just
terminate the scanning when you find \u0000.


I considered this to be too dangerous.  Another possibility is to check
that all the characters have the same high byte.  Does that actually
indicate anything meaningful though?

I'm afraid not. For instance in Czech you use plain ascii letters (<128) intermixed with letters whose codes go above 0x100.


However, if you restrict the high byte to a value less than 0xF, you already cover all the ISO8859-X charsets while keeping some protection against total garbage.

This won't be fair to a lot of languages out there, but this is only for bad hardware anyway, so people who write descriptors in those languages have to build good hardware :)

--
Paulo Marques - www.grupopie.com

To err is human, but to really foul things up requires a computer.
Farmers' Almanac, 1978


------------------------------------------------------- This SF.Net email is sponsored by: YOU BE THE JUDGE. Be one of 170 Project Admins to receive an Apple iPod Mini FREE for your judgement on who ports your project to Linux PPC the best. Sponsored by IBM. Deadline: Sept. 24. Go here: http://sf.net/ppc_contest.php _______________________________________________ [EMAIL PROTECTED] To unsubscribe, use the last form field at: https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to