Closed armon closed 11 years ago
Thanks.
No need to send a minimal test case. I see the error. I'd upload a fix pronto.
Thanks!
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.