Closed thinkbeforecoding closed 10 years ago
Currently, UTF8 is the system-wide default. This was chosen since it is the optimal encoding for BinaryWriter in the binary format. A solution to this perhaps would be to let each format implementation choose its own default encoding, by making IPickleFormatProvider take optionals.
I have attempted to address the issue here: bc91d26a0096cdee05aac1ad80313f5c534ba31c
Let me know if this works.
Yes it works ! Great
when using
json.Pickle v
with default encoding, the result is a byte[] starting with UTF8 byte order mark.This first caracter is not valid in json and is not ignored by others deserializers (try with jsonlint).
A workaround is to use System.Text.UTF8Encoding(false) for encoding, but it could be better to use it as default.