manuelbl / JavaDoesUSB

USB library for Java
MIT License
136 stars 10 forks source link

Consistent string descriptors #8

Open manuelbl opened 1 year ago

manuelbl commented 1 year ago

USB devices can provide string descriptors such a manufacturer and product name in different languages. On macOS and Linux, the relevant string descriptors are fetched by the operating system. On Windows, this library queries them explicitly with control requests.

It is unclear, which language version is used on the different operating systems, and if they are consistent across all operating systems.

The goal of this issue is to fix investigate it and fix inconsistencies.

manuelbl commented 1 year ago

Analysis Linux:

Linux seems to retrieve the first languages (declared in string string descriptor with index 0).

Analysis Windows:

For the Windows implementation, manufacturer and product name are retrieved using an explicit GetDescriptor request as there is no obvious way to get the information from Windows during device enumeration. As such, it is up to this library to specify the language ID.