Skip to content

How do you solve the problem of variable length encoding storage and decoding? #1

Description

@picturetxl

After the implementation of character encoding, you need to encode each character and write it to a file. I saw your code. You write the code table to the file first and end with #, and then read each character in the test file. But I don't understand why you save the character encoding in a byte, It can also accurately extract the corresponding characters from the encoded binary file.
For example, a is encoded as 110, B is encoded as 01001, C is encoded as 1001010101, how do you do when ABC is stored in a file? At this time, the encoding of C has exceeded 8 bits. How do you restore these bits to the original ABC in the decoding process.

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