-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
strftime produces corrupted characters in windows #2961
Comments
Huh weird, possibly to pipe it thru |
Did you try |
Sure. echo 1435677542.822351 | jq "strftime(\"%A, %B %d, %Y\")" > jq#2961.txt
Yes, of course. Same for any codepage. $ chcp 65001
$ echo 1435677542.822351 | jq "strftime(\"%A, %B %d, %Y\")"
"�������, ���� 30, 2015" |
Managed to kind of produce it with wine (no windows dev setup atm) and jq-windows-amd64.exe $ docker run --platform linux/amd64 -ti --rm debian:bookworm
$ apt-get update
$ apt-get install -y curl wine
$ curl -OLJ https://github.com/jqlang/jq/releases/download/jq-1.7/jq-windows-amd64.exe
# same with LC_ALL=ru_RU.UTF-8
$ LC_ALL=ru_RU.CP1251 wine jq-windows-amd64.exe -n '1435677542.822351 | strftime("%A, %B %d, %Y")'
<lots-of-warnings>
"???????, ???? 30, 2015"
$ LC_ALL=ru_RU.UTF-8 wine jq-windows-amd64.exe -n '1435677542.822351 | strftime("%A, %B %d, %Y")'
<lots-of-warnings>
"???????, ???? 30, 2015"
# default local (if i run locale is says "POSIX")
$ wine jq-windows-amd64.exe -n '1435677542.822351 | strftime("%A, %B %d, %Y")'
"Tuesday, June 30, 2015"
# swedish seems to work
$ LC_ALL=sv.SE.CP1251 wine jq-windows-amd64.exe -n '1435677542.822351 | strftime("%A, %B %d, %Y")'
"tisdag, juni 30, 2015" No idea how compareable this is to a proper windows installation but maybe there is something with msys2 and some locales etc? |
I wonder if we have to make |
I can not reproduce the issue with jq from msys2 https://packages.msys2.org/base/mingw-w64-jq
No locale variable set, system language is US English. |
Seems like non-latin characters are corrupted. |
Describe the bug
Using
strftime
function in Windows produces unreadable symbols in console.To Reproduce
Taken from
jq/tests/optional.test
Line 16 in 693a726
jq/tests/jq.test
Line 1562 in 693a726
Using both windows 1251 and utf 8 encodings gives same corrupted output.
Expected behavior
The output should be readable.
Environment (please complete the following information):
Additional context
Both files contain same test case.
The text was updated successfully, but these errors were encountered: