Skip to content

Conversation

@pepperoni505
Copy link

Currently, the putString and makeString functions in the buffer utilities file treat the string as a UTF-8 encoded string. However, SimConnect uses Windows-1252 encoding. We noticed this issue when inspecting the RecvOpen details of a P3D connection; the string was read as Lockheed Martin� Prepar3D� v6. With this fix, the string reads properly.

@EvenAR
Copy link
Owner

EvenAR commented Nov 29, 2025

Thanks for the PR! I really appreciate that you looked into this and identified the cause.

I noticed that this test is now failing. Have you had a chance to look into it?

The expected packet in that test is based on a “real” SimConnect message captured from a small test app I wrote using the official SDK. However, it’s possible that my compiler or project settings caused the string to be encoded as UTF-8 instead of the expected Windows code page, so the reference packet might be incorrect.

Did you find any documentation specifying that Windows-1252 is the correct encoding? According to jSimconnect, most packets are sent using ISO-8859-1 (which, as far as I understand, is very similar to Windows-1252).

@pepperoni505
Copy link
Author

Hey, sorry I swear I had responded 😓

Unfortunately I haven't had an opportunity to really look into it. We went with a patch that used win1252 and it worked for us, but I honestly forget the reasoning behind why it was chosen (there was an actual reason IIRC).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants