You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
BinaryReader defaults to Encoding.UTF8, which replaces invalid UTF-8 data with the U+FFFD replacement char. This differs from both the MS-NRBF spec and the existing BinaryFormatter behavior, which requires well-formed UTF-8. Consider creating a UTF8Encoding instance using the public ctor and passing throwOnInvalidBytes: true, then using that for all operations.
BinaryReader.ReadString does not enforce minimal-representation 7-bit encoded integers, though MS-NRBF requires it. Either: (a) reimplement the ReadString helper method yourself to enforce minimal representation; or (b) explicitly document that the reader does not enforce this aspect of the spec, and document the consequences resulting from it.
The text was updated successfully, but these errors were encountered:
BinaryReader
defaults toEncoding.UTF8
, which replaces invalid UTF-8 data with theU+FFFD
replacement char. This differs from both the MS-NRBF spec and the existingBinaryFormatter
behavior, which requires well-formed UTF-8. Consider creating aUTF8Encoding
instance using the public ctor and passing throwOnInvalidBytes: true, then using that for all operations.BinaryReader.ReadString
does not enforce minimal-representation 7-bit encoded integers, though MS-NRBF requires it. Either: (a) reimplement theReadString
helper method yourself to enforce minimal representation; or (b) explicitly document that the reader does not enforce this aspect of the spec, and document the consequences resulting from it.The text was updated successfully, but these errors were encountered: