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

write_str_fixed with cp932 #2

Closed
SamuraiOndo opened this issue Jun 10, 2022 · 1 comment
Closed

write_str_fixed with cp932 #2

SamuraiOndo opened this issue Jun 10, 2022 · 1 comment

Comments

@SamuraiOndo
Copy link

The current way write_str_fixed is implemented does not work with cp932, as each character is two bytes. Because it reads the string length and not how many bytes there are, it doesn't write the correct buffer length.

Multiplying the string length by two solves this in SOME cases, but it does not account for the spaces which are just one byte. This is surely an issue for other multiple byte encodings, although I only know it is a problem for cp932.

@mosamadeeb
Copy link
Owner

Just to make sure, you're expecting the number of bytes to be written to be equal to the size argument, right?

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

2 participants