Duncan Sands wrote:
On Saturday 24 July 2004 21:45, Alan Stern wrote:

On Sat, 24 Jul 2004, Duncan Sands wrote:


I have a "freebox", an ADSL modem.  When reading various string
descriptors, the bLength and bDescriptorType fields are both zero,
yet appropriate data follows, see the examples below:

# Format is: bLength bDescriptorType - DATA
# where DATA is a sequence of printable characters.
# Wierdo characters are replaced by ? (none here),
# and null by !.  So 0 0 - F!r!e!e!B!o!X!!!!... means
# bLength=0, bDescriptorType=0, then
# F(null)r(null)e(null)e(null)B(null)o(null)X(null)(null)(null)...)

Product:

0 0 - F!r!e!e!B!o!X!!!!...

Manufacturer:

0 0 - F!r!e!e!b!o!x! !S!A!!!...

Serial number?:

0 0 - 1!.!0!0!!!...

Any idea how to handle these strange strings?  Could these
guys be using an unofficial convention for sending null terminated
strings?

Maybe you have probably noticed this already, but this strange strings look like unicode UCS-16 encoded. Microsoft at one point was pushing really hard for UCS-16 everything and use "wide strings" everywhere. (to the point that WindowsCE initially only supported those)


So maybe they created an "extension" to the standard where the device can send unicode strings (so that you can have device names in any language) if it reports descriptor type 0. Naturally, this are all just assumptions.

Encoding this things as utf-8 would seem much better (to me, at least). ASCII names would Just Work(tm), the length field could keep its meaning, etc. This means that Microsoft had to choose the non-standard, stupidest path :)

Just my 2 cents,

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