NinevaStudios / mqtt-utilities-unreal

MqttUtilities is a plugin for Unreal Engine intended to expose MQTT client functionality to blueprints
Eclipse Public License 1.0
157 stars 60 forks source link

Cannot send messages with more than 128 characters with Windows #5

Open Forstulen opened 3 years ago

Forstulen commented 3 years ago

Hello,

I found an issue with this plugin while sending json payloads encoded in Base64. They usually hit more than 128 characters and this line (located in StringUtils.cpp) doesn't send the expected result:

const char* originalStr = TCHAR_TO_ANSI(*str);

I managed to solve this by changing this line by something else found on the internet (Here):

auto originalFString = StringCast<ANSICHAR>(*str);
const char* originalStr = originalFString.Get();

Hope it can help.

Regards.

Impulse87 commented 1 year ago

Same issue with Linux, 127 bytes work fine, but 128+ bytes are scrambled. Copied the state from the windows StringUtils.cpp and it works for Linux now, too.