-
Notifications
You must be signed in to change notification settings - Fork 295
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Latest commit causes decode to break #17
Comments
Thanks. No need to send a minimal test case. I see the error. I'd upload a fix pronto. |
Thanks! |
This is inline with kMap logic. We needed to replicate it in the fast-path decMapIntfIntf. Fixes issue #17 .
Sorry, quick question, will the conversion of []byte to string potentially cause problems if the data is not UTF8 format? |
The latest commit does fix our issue though. Thanks for the quick turn around! |
Please re-test and confirm fix. No - it will not cause an issue. This is in line with the old logic before (see kMap method). We special-case and fast-tracked some common map types, and I forgot to replicate that check in there. The reason for doing this, is that the original msgpack encodes a string as raw []byte (there was no separate string or binary type). When decoding, we need to make a determination what to do when we see raw bytes. We use the following to make that determination:
A string in Go is just an immutable string of bytes - it doesn't specify an encoding. There are libs to treat it as utf8, utf16, runes (utf-32), etc. |
And thanks for reporting this quickly. Much appreciated. I pride myself on not overlooking things, and am happy you caught this one for me quickly before others ran across it, and wasted time checking if the problem was on their end. |
Thanks for the response and the excellent library! Cheers. |
Latest version is causing issues for us, as we now get the following:
Still trying to get a minimal test case, but I can reproduce this in our project test suite.
The text was updated successfully, but these errors were encountered: