Encode/decode strings with win1252#115
Conversation
|
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). |
|
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). |
Currently, the
putStringandmakeStringfunctions 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 theRecvOpendetails of a P3D connection; the string was read asLockheed Martin� Prepar3D� v6. With this fix, the string reads properly.