Skip to content

UTF-8 validation when deserializing #71

@kolmodin

Description

@kolmodin

As pointed out in #70 by @ttuegel we don't do validation of UTF-8 when decoding. This needs to be fixed.

Consider introducing getList in Binary if it makes a big difference for performance. With getList we could use some of the faster UTF-8 validators without having to write our own. See how text does utf8 validation . Our case might be more difficult though as we don't know beforehand whether all input bytes are available.

class Binary a where
  -- ...
  getList :: [a]
  getList = getDefaultList

getDefaultList :: Binary a => Get [a]
getDefaultList = get >>= getMany

class Binary Char where
  -- ...
  getList = -- faster code

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions