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

[Error] asciinema needs a UTF-8 #160

Closed
abhisekp opened this issue May 26, 2016 · 16 comments
Closed

[Error] asciinema needs a UTF-8 #160

abhisekp opened this issue May 26, 2016 · 16 comments
Milestone

Comments

@abhisekp
Copy link

I'm getting this error in Ubuntu 16.04 64b after adding the ppa and updating. Previously, I had Version: 1.0.16 and now I've Version: 1.2.0-1.
Previously, it was all working fine. Why does this error show? What are the benefits this check? https://github.com/asciinema/asciinema/blob/master/main.go#L103

➔ asciinema --version    
asciinema needs a UTF-8 native locale to run. Check the output of `locale` command.

➔ locale
LANG=en_IN
LANGUAGE=en_IN:en
LC_CTYPE=en_IN
LC_NUMERIC="en_IN"
LC_TIME="en_IN"
LC_COLLATE="en_IN"
LC_MONETARY="en_IN"
LC_MESSAGES="en_IN"
LC_PAPER="en_IN"
LC_NAME="en_IN"
LC_ADDRESS="en_IN"
LC_TELEPHONE="en_IN"
LC_MEASUREMENT="en_IN"
LC_IDENTIFICATION="en_IN"
LC_ALL=
@ku1ik
Copy link
Contributor

ku1ik commented May 27, 2016

We have this requirement in order to force all commands that you run inside asciinema recording session to use UTF-8. By ensuring the captured stdout stream is in UTF-8, the asciinema web player implementation can be much simpler, without need to deal with char encodings and all related complexity.

What's the character encoding you're using? (I don't see encoding specification in your locale output).

@abhisekp
Copy link
Author

abhisekp commented May 27, 2016

@sickill I didn't manually change anything. It was like that when I installed my Ubuntu box. I live in India, btw.

en_IN probably stands for Indian English 😕

what to do now?

@abhisekp
Copy link
Author

abhisekp commented May 27, 2016

@sickill this is my output of /usr/share/i18n/SUPPORTED
en_IN is actually UTF-8 😺

.
.
.
en_HK.UTF-8 UTF-8
en_HK ISO-8859-1
en_IE.UTF-8 UTF-8
en_IE ISO-8859-1
en_IE@euro ISO-8859-15
en_IN UTF-8 <----------------------------------------- 
en_NG UTF-8
en_NZ.UTF-8 UTF-8
en_NZ ISO-8859-1
en_PH.UTF-8 UTF-8
en_PH ISO-8859-1
.
.
.

How about a quick patch? 😉

@ku1ik
Copy link
Contributor

ku1ik commented May 27, 2016

Not sure what would be the best way to fix this. But meanwhile you can alias asciinema="LC_CTYPE=en_IN.UTF-8 asciinema" maybe?

@abhisekp
Copy link
Author

abhisekp commented May 27, 2016

That is so wrong to do. LOL. 😄
jk

But whatever it takes to run the app 😉
If I had to climb a mountain 🗻 , I would do that. 😄

@abhisekp
Copy link
Author

@sickill Thank you. It works but please fix this soon. 👷 🔨 🚧

@ku1ik
Copy link
Contributor

ku1ik commented May 27, 2016

I know it's not the prettiest solution, but as a temporary workaround must do for now ;)

@ku1ik ku1ik added this to the 1.3.0 milestone Jul 6, 2016
@ku1ik
Copy link
Contributor

ku1ik commented Jul 13, 2016

@abhisekp I just released v1.3.0 which should solve this problem. Can you check it? sudo pip3 install asciinema.

@abhisekp
Copy link
Author

@sickill yay! it works ...

@ReSearchITEng
Copy link

ReSearchITEng commented May 15, 2017

This is still failing, even on asciinema 1.4 .

$asciinema
asciinema needs a UTF-8 native locale to run. Check the output of `locale` command.```
$locale
LANG=en_US.UTF-8
LC_CTYPE="C"
LC_NUMERIC="C"
LC_TIME="C"
LC_COLLATE="C"
LC_MONETARY="C"
LC_MESSAGES="C"
LC_PAPER="C"
LC_NAME="C"
LC_ADDRESS="C"
LC_TELEPHONE="C"
LC_MEASUREMENT="C"
LC_IDENTIFICATION="C"
LC_ALL=C

SOLUTION:
export LC_ALL=${LANG}

@ku1ik
Copy link
Contributor

ku1ik commented May 16, 2017

It's enough to only set LC_CTYPE="*.UTF-8".

@ReSearchITEng
Copy link

ReSearchITEng commented May 16, 2017 via email

@ku1ik
Copy link
Contributor

ku1ik commented May 23, 2017

Looks like they're not enough indeed :)

@just4t
Copy link

just4t commented Jul 9, 2018

Same issue having by default:

# locale
LANG=en_US
LANGUAGE=
LC_CTYPE="en_US"
LC_NUMERIC="en_US"
LC_TIME="en_US"
LC_COLLATE="en_US"
LC_MONETARY="en_US"
LC_MESSAGES="en_US"
LC_PAPER="en_US"
LC_NAME="en_US"
LC_ADDRESS="en_US"
LC_TELEPHONE="en_US"
LC_MEASUREMENT="en_US"
LC_IDENTIFICATION="en_US"
LC_ALL=

Worked here by entering:

export LC_ALL=en_US.UTF-8

Then, the final output to locale command:

# locale
LANG=en_US
LANGUAGE=
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_PAPER="en_US.UTF-8"
LC_NAME="en_US.UTF-8"
LC_ADDRESS="en_US.UTF-8"
LC_TELEPHONE="en_US.UTF-8"
LC_MEASUREMENT="en_US.UTF-8"
LC_IDENTIFICATION="en_US.UTF-8"
LC_ALL=en_US.UTF-8

@just4t
Copy link

just4t commented Jul 10, 2018

Noticed still fails on some CLOUD server(s) running Ubuntu 16.04 LTS (not detected the issue over Ubuntu 18.04 LTS CLOUD servers) ...

Fixed through SSH with:
update-locale LANG=en_US.UTF-8

Or manually by editing the /etc/default/locale file with this content:
LANG="en_US.UTF-8"

Hope this helps others!

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

4 participants