mirror of
https://github.com/asciinema/asciinema.git
synced 2026-04-25 07:55:51 +03:00
[GH-ISSUE #206] asciinema needs a UTF-8 native locale to run. Check the output of locale command. #764
Labels
No labels
bug
compatibility
feature request
fit for beginners
help wanted
hosting
idea
improvement
packaging
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/asciinema#764
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @ReSearchITEng on GitHub (May 15, 2017).
Original GitHub issue: https://github.com/asciinema/asciinema/issues/206
This is a reopen of #160. This is still failing, even on asciinema 1.4 , latest in epel for centos/RH v7.
SOLUTION:
@ku1ik commented on GitHub (May 16, 2017):
As I mentioned in #160, it's enough to only set
LC_CTYPE="*.UTF-8". If you do it then you can setLANGand other as you wish.@cmoulliard commented on GitHub (Oct 2, 2018):
This trick doesn't work on Macos
@ku1ik commented on GitHub (Nov 16, 2018):
I think I wasn't clear enough, sorry about that. What I meant by
export LC_CTYPE="*.UTF-8"isexport LC_CTYPE="en_US.UTF-8"(or other specific locale).*was just a thought shortcut :)@ghost commented on GitHub (Dec 9, 2018):
This bug is affecting a musl-based stack, while @sickill 's fix does not solve the problem.
@ku1ik commented on GitHub (Dec 10, 2018):
I merged #302 recently. Is this going to solve it for musl-based stack you think @lifranc ?
@arielf commented on GitHub (Jan 29, 2019):
Hello @sickill
Thanks for writing this cool software.
Seems like this issue still exists in latest (fresh clone 2019-01-29, Ubuntu 18.04):
When I set
LC_ALL=${LANG}(wasC) - the problem goes away.I happen to have
LC_ALL=Cwhich should behave similar to ASCII.If ASCII is allowed, perhaps
Ccould be allowed as well?@just4t commented on GitHub (Jan 29, 2019):
No doubt this should be fixed within the install script as some Ubuntu 18.04 LTS provider provided images don't have locale set by default...
Then try to install again. Hope this helps.
@ghost commented on GitHub (Jan 30, 2019):
@sickill My musl infra borked and I then took an oath never to leave nixOS again. But we started an early fork to rebase nixOS on musl although I could take months before the switch we'll be able to test then. The whole locale situation is rather ugly right now so we'll look for a sane solution.
@p-alik commented on GitHub (Feb 28, 2019):
setting
LC_ALLsolves the issue on NixOS also.@ku1ik commented on GitHub (Mar 17, 2019):
2.0.2 was released with #302 fix. It now works fine on
Cand*.UTF-8.In case you run
env LC_CTYPE="en_US.UTF-8" asciinema ...and it still doesn't work, it could be that your OS doesn't have local files generated properly, and you may need to uncomment it in/etc/locale.gen, then runsudo locale-gen.@ku1ik commented on GitHub (Mar 17, 2019):
The check for character encoding happens here: https://github.com/asciinema/asciinema/blob/develop/asciinema/main.py#L53
It uses Python's built-in
localemodule.@lifranc I'm not familiar with musl too much, and how musl-based Python builds implement the locale support, but I'm happy to add necessary changes to make it work under nixOS (or musl in general).
@ghost commented on GitHub (Mar 18, 2019):
@sickill nixOS doesnt use musl - our fork of it will. I'm not testing the musl stack currently, busy with other things. Musl doesnt have
local-gen, which I fundamentally agree with. But there's a project, which I haven't testetd, to add the funcionality here - https://gitlab.com/rilian-la-te/musl-locales@frak0d commented on GitHub (Jan 29, 2022):
Can't we just have a force override flag ?
I have tried everything but it still complains about locale.
@ku1ik commented on GitHub (Feb 6, 2022):
The reason asciinema requires UTF-8 charset is so we don't need to deal with countless different char encodings when replaying the recording. If the charset is set properly for your shell then all programs you run inside asciinema session will output UTF-8. If we had a flag that overrides this check it would mean the output asciinema captures is not guaranteed to be UTF-8, which in turn could lead to garbage being saved in the output asciicast file. But I guess we could have such force override option that would be marked as "on your own risk".
@upstream-dmahlberg commented on GitHub (Feb 6, 2022):
I'm experiencing the same issue. Running on Manjaro with the Snap package. A flag would be awesome.
@mathieu-aubin commented on GitHub (Jun 9, 2022):
Try the simplest easiest solution of setting on the command line BEFORE the program call... as in;
LC_ALL=en_US.UTF-8 asciinema rec -c 'locale'Set a shell alias for easy going
@sickill BTW, this wont upload complaining of duration invalid - am i just in a bug time or is this relevant and an actual potential issue?
@wongjiahau commented on GitHub (Mar 7, 2023):
This works in my Ubuntu docker container as well, thanks.
@ku1ik commented on GitHub (Mar 7, 2023):
At this point I don't think there's any remaining bug in asciinema with regards to locale handling (requirement of UTF-8 charset is desired behavior), so I'm closing it.
@fuzzko commented on GitHub (May 3, 2023):
The issue still going.
I have asciinema installed via package manager (Paru) in Arch Linux (Proot). Apparently the error about Locale being not UTF-8 or ASCII is happening in my Arch Linux.
I've also tried
LC_ALL="en_US.UTF-8"and others possible fixes, still it doesn't affect anything.@ku1ik commented on GitHub (May 4, 2023):
@UrNightmaree What asciinema version do you have? What's the output of
LC_ALL=en_US.UTF-8 locale?@fuzzko commented on GitHub (May 6, 2023):
@sickill Sorry for long response, here's the output.
@ku1ik commented on GitHub (May 6, 2023):
@UrNightmaree yeah, so you don't have
en_US.UTF-8locale generated on your system. See here https://github.com/asciinema/asciinema/issues/206#issuecomment-473658629@fuzzko commented on GitHub (May 6, 2023):
@sickill Thank you, that fixed the issue. 😄