Commit f37c561
committed
Convert the the USB device name UTF8
The USB device name is a UTF16 string but the `spndev.name` is a `char *`.
This causes confusion when someone tries to `printf` the device name and
gets only the first character, because the second byte is 0.
To avoid this convert the device name to UTF8. For devices whose names are
ASCII (most cases) this will result in a plain ASCIIZ string and avoid
confusion.
At the same time the driver API remains "simple" for embedded platforms
where the USB HID implementation will not be HIDAPI and Unicode support
may be missing (or too large to compile in).
Fixes #61 parent 8b6be39 commit f37c561
1 file changed
Lines changed: 8 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
145 | 145 | | |
146 | 146 | | |
147 | 147 | | |
| 148 | + | |
| 149 | + | |
148 | 150 | | |
149 | 151 | | |
150 | 152 | | |
151 | 153 | | |
152 | | - | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
153 | 158 | | |
154 | 159 | | |
155 | 160 | | |
| 161 | + | |
| 162 | + | |
156 | 163 | | |
157 | 164 | | |
158 | 165 | | |
| |||
0 commit comments