Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-132202

Qt bluetooth qlowenergycontroller_winrt.cpp incorrectly assumes CharacteristicUserDescription returns UTF16 when it actually returns UTF8

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P2: Important
    • 6.5.9, 6.8.2, 6.9.0 Beta2, 6.10.0 FF
    • 6.5.3, 6.7.0, 6.8.1
    • None
    • Windows 11 23H2
      Qt 6.8.1 Qt 6.7.0 Qt 6.5.3
      MSVC2022 64bit
    • Windows
    • 3
    • e93b602dd (dev), 867c18db8 (6.9), d0c14973e (6.8), d0fb34321 (tqtc/lts-6.5)
    • Foundation Sprint 122

    Description

      On the Windows platform, for characteristics that have a User Description, tthere is a garbled text issue with the characteristic names displayed in the example lowenergyscanner

      Look at the following picture. The red box on the left side of the image should display "Enter Sleep Mode" instead of garbled text (the right side of the image shows the result viewed using the Bluetooth LE Explorer software).

       

      We discussed this issue on the Qt forum and found that it seems to be caused by the QWinRTLowEnergyServiceHandler::obtainCharList function and the QLowEnergyControllerPrivateWinRT::readDescriptorHelper function in qlowenergycontroller_winrt.cpp incorrectly assuming that CharacteristicUserDescription returns UTF-16 (when in fact it returns UTF-8), which led to this error. For more details, please refer to https://forum.qt.io/post/816777, https://forum.qt.io/post/816778.

      For the full discussion, please refer to: https://forum.qt.io/topic/160084/how-to-solve-the-problem-of-garbled-characters-in-characteristic-names-for-lowenergyscanner-on-the-windows-platform.

      Attachments

        1. image-2024-12-21-00-59-24-687.png
          179 kB
          Dragon Asking
        2. image-2024-12-21-01-09-12-331.png
          200 kB
          Dragon Asking
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            ivan.solovev Ivan Solovev
            swjqq Dragon Asking
            Vladimir Minenko Vladimir Minenko
            Alex Blasche Alex Blasche
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes