Skip to content

grpc-labview serializes strings using the ANSI code page, not UTF-8 #461

@bkeryan

Description

@bkeryan

LabVIEW strings are encoded using the system's ANSI code page. Protobuf strings are UTF-8. grpc-labview should translate strings between ANSI and UTF-8, but it doesn't.

Steps to reproduce

  1. Install LabVIEW, InstrumentStudio, NI-DMM, and https://github.com/ni/measurement-plugin-labview
  2. Use HWCU to add a simulated PXIe-1062Q and a PXIe-4080 named DMM1.
  3. Open C:\Program Files\National Instruments\LabVIEW 2023\examples\Plug-Ins\Measurements\NI-DMM Measurement\NIDmmMeasurement\Get Measurement Details.vi and change the display name to use https://graphemica.com/%C3%A9:
    Image
  4. Run C:\Program Files\National Instruments\LabVIEW 2023\examples\Plug-Ins\Measurements\NI-DMM Measurement\NIDmmMeasurement\Run Service.vi

Expected behavior

The service registers with the discovery service using a display name of NI-DMM Méasuremént (LabVIEW)

Actual behavior

Run Service.vi:

Error -1002 occurred at ni.measurementlink.discovery.v1.api.lvlib:DiscoveryService RegisterService.vi:2390001

Possible reason(s):

Exception was thrown by handler.


Complete call chain:
     ni.measurementlink.discovery.v1.api.lvlib:DiscoveryService RegisterService.vi:2390001
     NI Measurement Plug-In SDK.lvlib:Register to Discovery Service.vi
     NI Measurement Plug-In SDK.lvlib:Run Service.vi:3120001
     NIDmmMeasurement.lvlib:Run Service.vi

C:\ProgramData\National Instruments\Plug-Ins\Logs\DiscoveryService.txt:

===== 07/23/2025 14:27:38 ===== Information: Error reading message.
===== 07/23/2025 14:27:38 ===== Error: Error when executing service method '"RegisterService"'.
===== 07/23/2025 14:27:38 ===== Information: HTTP "POST" "/ni.measurementlink.discovery.v1.DiscoveryService/RegisterService" responded 200 in 0.5765 ms
===== 07/23/2025 14:27:38 ===== Information: Service unregistered successfully. RegistrationId: ""
===== 07/23/2025 14:27:38 ===== Information: HTTP "POST" "/ni.measurementlink.discovery.v1.DiscoveryService/UnregisterService" responded 200 in 0.1059 ms

Notes

'é' is 0xE9 in the Windows 1252 code page and U+00E9 in Unicode, but 0xE9 is not valid UTF-8. The UTF-8 encoding of U+00E9 is 0xC3 0xA9.

Reference: https://graphemica.com/%C3%A9

Wireshark confirms that grpc-labview is sending 0xE9 over the network without converting it to UTF-8:

Image

AB#3207176

Metadata

Metadata

Assignees

Labels

type: bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions