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

Codepage error on Windows #138

Closed
sergeevabc opened this issue Jan 30, 2024 · 2 comments · Fixed by #139
Closed

Codepage error on Windows #138

sergeevabc opened this issue Jan 30, 2024 · 2 comments · Fixed by #139

Comments

@sergeevabc
Copy link

sergeevabc commented Jan 30, 2024

Windows 7 x64, base64 0.5.2

$ for %# in (*) do @echo %# %~z#
birds.txt 1024
vögel.txt 3072

$ base64 birds.txt > birds.txt.b64

$ base64 vögel.txt > vögel.txt.b64
base64: vogel.txt: No such file or directory
Usage: base64 [OPTION]... [FILE]
If no FILE is given or is specified as '-', read from standard input.
Options:
  -d, --decode             Decode a base64 stream.
  -h, --help               Print this help text.
  -i, --ignore-garbage     When decoding, ignore any non-base64 data.
  -n, --no-strip-newlines  When decoding, do not strip newlines. Speeds up
                           decoding of inputs that do not contain newlines.
  -w, --wrap=COLS          Wrap encoded lines at this column. Default 76, 0 to
                           disable.

$ for %# in (*) do @echo %# %~z#
birds.txt     1024
birds.txt.b64 1404
vögel.txt     3072
vögel.txt.b64 0

$ coreutils base64 vögel.txt > vögel.txt.b64

$ for %# in (*) do @echo %# %~z#
birds.txt     1024
birds.txt.b64 1404
vögel.txt     3072
vögel.txt.b64 4150

Changing local ANSI codepage to Unicode via chcp 65001 does not help.

@aklomp
Copy link
Owner

aklomp commented Jan 30, 2024

bin/base64 is a demo program that shows how to integrate the base64 library into a program. It is not intended for production use and it is not intended to be cross-platform. It's a demo. Furthermore, Windows 7 is obsolete and support from Microsoft ended over four years ago.

I'm not going to update a demo program to work on an obsolete platform. If anyone wants to contribute a patch, I can review it.

@sergeevabc
Copy link
Author

sergeevabc commented Jan 30, 2024

This bug is reproduced under Windows 10 and 11. But the fact that you are trying to avoid investigating the well-documented bug says more about your self-confidence than about Microsoft. After all, we can all miss something, but only lazybones and laymen insist on leaving the omission as it is. In fact, this is a chance to expand your knowledge in the field of cross-platform development.

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

Successfully merging a pull request may close this issue.

2 participants