MadLittleMods / node-usb-detection

List USB devices in system and detect changes on them.
MIT License
370 stars 114 forks source link

bugfix: deviceName garbled in Windows #34 #86

Closed nononoone closed 4 years ago

nononoone commented 5 years ago

Fix https://github.com/MadLittleMods/node-usb-detection/issues/34

Fix deviceName garbled in Windows

MadLittleMods commented 5 years ago

@nononoone Can you give a before after results when you use usbDetect.find?

nononoone commented 5 years ago

@nononoone Can you give a before after results when you use usbDetect.find?

before:

G:\Test\node_modules\usb-detection\test>node dev-helper-test.js
startMonitoring
find 14 [ { locationId: 0,
    vendorId: 0,
    productId: 0,
    deviceName: 'USB Root Hub',
    manufacturer: '(��׼ USB ��������)',
    serialNumber: '',
    deviceAddress: 12 },
  { locationId: 0,
    vendorId: 0,
    productId: 0,
    deviceName: 'USB Root Hub',
    manufacturer: '(��׼ USB ��������)',
    serialNumber: '',
    deviceAddress: 3 },
  { locationId: 0,
    vendorId: 0,
    productId: 0,
    deviceName: 'USB ��������(USB 3.0)',
    manufacturer: '(��׼ USB ������)',
    serialNumber: '',
    deviceAddress: 10 },

after:

G:\Working\Test\node_modules\usb-detection\test>node dev-helper-test.js  
startMonitoring
find 14 [ { locationId: 0,
    vendorId: 0,
    productId: 0,
    deviceName: 'USB Root Hub',
    manufacturer: '(标准 USB 主控制器)',
    serialNumber: '',
    deviceAddress: 12 },
  { locationId: 0,
    vendorId: 0,
    productId: 0,
    deviceName: 'USB Root Hub',
    manufacturer: '(标准 USB 主控制器)',
    serialNumber: '',
    deviceAddress: 3 },
  { locationId: 0,
    vendorId: 0,
    productId: 0,
    deviceName: 'USB 根集线器(USB 3.0)',
    manufacturer: '(标准 USB 集线器)',
    serialNumber: '',
    deviceAddress: 10 },
ilopsource commented 5 years ago

V4.3.0 encountered the same bug, I hope to be able to merge this code in the new version,please

MadLittleMods commented 4 years ago

Sorry for the delay @nononoone 🥶

This is now shipped in usb-detection@4.4.0 :tada:

Thanks for the fix ❤️