Skip to content

Variable length decoding #257

@NickStallman

Description

@NickStallman

How would you go about decoding a variable length format, like just for example UTF-8?

It needs to:

  1. Read a single byte, if the values are between x and y then it's a single byte
  2. Else read a second byte and then treat it as a single 16 bit value
  3. This process could continue

My specific use case has a single byte command, except when that byte is 0xfe in which case it's a two byte command. It's a very rudimentary case where more than 256 commands were needed so they just created a 2nd list of 256 commands.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions