Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
picturetxl opened this issue Jul 1, 2021 · 0 comments

Comments

@picturetxl
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant