Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse

NodeBB

  1. Home
  2. uncategorized
  3. We had a weird encoding bug at work.

We had a weird encoding bug at work.

Scheduled Pinned Locked Moved uncategorized
5 Posts 4 Posters 0 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • volpeon@icy.wyvern.ripV This user is from outside of this forum
    volpeon@icy.wyvern.ripV This user is from outside of this forum
    volpeon@icy.wyvern.rip
    wrote last edited by
    #1

    We had a weird encoding bug at work. Turns out the HiveMQ MQTT library uses ASCII when calling PublishAsync(string topic, string payload), but UTF-8 when creating the MQTT5PublishMessage directly and sending that with PublishAsync.

    Why????????

    kura@hai.z0ne.socialK ? ? 3 Replies Last reply
    0
    • volpeon@icy.wyvern.ripV volpeon@icy.wyvern.rip

      We had a weird encoding bug at work. Turns out the HiveMQ MQTT library uses ASCII when calling PublishAsync(string topic, string payload), but UTF-8 when creating the MQTT5PublishMessage directly and sending that with PublishAsync.

      Why????????

      kura@hai.z0ne.socialK This user is from outside of this forum
      kura@hai.z0ne.socialK This user is from outside of this forum
      kura@hai.z0ne.social
      wrote last edited by
      #2

      @volpeon@icy.wyvern.rip sounds like a great library to me

      1 Reply Last reply
      0
      • volpeon@icy.wyvern.ripV volpeon@icy.wyvern.rip

        We had a weird encoding bug at work. Turns out the HiveMQ MQTT library uses ASCII when calling PublishAsync(string topic, string payload), but UTF-8 when creating the MQTT5PublishMessage directly and sending that with PublishAsync.

        Why????????

        ? Offline
        ? Offline
        Guest
        wrote last edited by
        #3

        @volpeon@icy.wyvern.rip obviously to confuse everyone

        1 Reply Last reply
        0
        • volpeon@icy.wyvern.ripV volpeon@icy.wyvern.rip

          We had a weird encoding bug at work. Turns out the HiveMQ MQTT library uses ASCII when calling PublishAsync(string topic, string payload), but UTF-8 when creating the MQTT5PublishMessage directly and sending that with PublishAsync.

          Why????????

          ? Offline
          ? Offline
          Guest
          wrote last edited by
          #4

          @volpeon
          I'm wondering if the tool is calling very different libraries internally

          volpeon@icy.wyvern.ripV 1 Reply Last reply
          0
          • ? Guest

            @volpeon
            I'm wondering if the tool is calling very different libraries internally

            volpeon@icy.wyvern.ripV This user is from outside of this forum
            volpeon@icy.wyvern.ripV This user is from outside of this forum
            volpeon@icy.wyvern.rip
            wrote last edited by volpeon@icy.wyvern.rip
            #5

            @GarretSidzaka I inspected the code and IIRC PublishAsync(topic, payload) ultimately constructs a MQT5PublishMessage as well and then calls the other PublishAsync. The difference is that it explicitly uses an ASCII encoder, whereas when you construct a MQT5PublishMessage yourself it defaults to a UTF-8 encoder. ​:neofox_googly:​

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Login or register to search.
            Powered by NodeBB Contributors
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups