[GH-ISSUE #160] [Error] asciinema needs a UTF-8 #738

Closed
opened 2026-03-15 10:07:08 +03:00 by kerem · 16 comments
Owner

Originally created by @abhisekp on GitHub (May 26, 2016).
Original GitHub issue: https://github.com/asciinema/asciinema/issues/160

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=
Originally created by @abhisekp on GitHub (May 26, 2016). Original GitHub issue: https://github.com/asciinema/asciinema/issues/160 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 ``` sh ➔ 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= ```
kerem closed this issue 2026-03-15 10:07:14 +03:00
Author
Owner

@ku1ik commented on GitHub (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).

<!-- gh-comment-id:222085037 --> @ku1ik commented on GitHub (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).
Author
Owner

@abhisekp commented on GitHub (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?

<!-- gh-comment-id:222085661 --> @abhisekp commented on GitHub (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 :confused: what to do now?
Author
Owner
<!-- gh-comment-id:222086740 --> @abhisekp commented on GitHub (May 27, 2016): @sickill something for you https://bugs.launchpad.net/ubuntu/+source/python-defaults/+bug/653259 Relevant: https://bugs.launchpad.net/ubuntu/+source/python-defaults/+bug/653259/comments/3
Author
Owner

@abhisekp commented on GitHub (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? 😉

<!-- gh-comment-id:222087074 --> @abhisekp commented on GitHub (May 27, 2016): @sickill this is my output of `/usr/share/i18n/SUPPORTED` `en_IN` is actually `UTF-8` :smiley_cat: ``` text . . . 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? :wink:
Author
Owner

@ku1ik commented on GitHub (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?

<!-- gh-comment-id:222093115 --> @ku1ik commented on GitHub (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?
Author
Owner

@abhisekp commented on GitHub (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. 😄

<!-- gh-comment-id:222095738 --> @abhisekp commented on GitHub (May 27, 2016): That is so wrong to do. LOL. :smile: _jk_ But whatever it takes to run the app :wink: _If I had to climb a mountain :mount_fuji: , I would do that._ :smile:
Author
Owner

@abhisekp commented on GitHub (May 27, 2016):

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

<!-- gh-comment-id:222128922 --> @abhisekp commented on GitHub (May 27, 2016): @sickill Thank you. It works but please fix this soon. :construction_worker: :hammer: :construction:
Author
Owner

@ku1ik commented on GitHub (May 27, 2016):

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

<!-- gh-comment-id:222231060 --> @ku1ik commented on GitHub (May 27, 2016): I know it's not the prettiest solution, but as a temporary workaround must do for now ;)
Author
Owner

@ku1ik commented on GitHub (Jul 13, 2016):

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

<!-- gh-comment-id:232300326 --> @ku1ik commented on GitHub (Jul 13, 2016): @abhisekp I just released v1.3.0 which should solve this problem. Can you check it? `sudo pip3 install asciinema`.
Author
Owner

@abhisekp commented on GitHub (Jul 13, 2016):

@sickill yay! it works ...

<!-- gh-comment-id:232306373 --> @abhisekp commented on GitHub (Jul 13, 2016): @sickill yay! it works ...
Author
Owner

@ReSearchITEng commented on GitHub (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}

<!-- gh-comment-id:301504759 --> @ReSearchITEng commented on GitHub (May 15, 2017): This is still failing, even on asciinema 1.4 . ```bash $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}```
Author
Owner

@ku1ik commented on GitHub (May 16, 2017):

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

<!-- gh-comment-id:301712433 --> @ku1ik commented on GitHub (May 16, 2017): It's enough to only set `LC_CTYPE="*.UTF-8"`.
Author
Owner

@ReSearchITEng commented on GitHub (May 16, 2017):

I see.
So the defaults we have in RHEL/Centos are not good enough for asciinema?

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

On Tue, May 16, 2017 at 11:28 AM, Marcin Kulik notifications@github.com
wrote:

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


You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/asciinema/asciinema/issues/160#issuecomment-301712433,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AG43M6dRcLL9t5y-22nTwG0rcEtJcdfuks5r6V5IgaJpZM4In9vV
.

<!-- gh-comment-id:301802559 --> @ReSearchITEng commented on GitHub (May 16, 2017): I see. So the defaults we have in RHEL/Centos are not good enough for asciinema? ``` 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 ``` On Tue, May 16, 2017 at 11:28 AM, Marcin Kulik <notifications@github.com> wrote: > It's enough to only set LC_CTYPE=*.UTF-8. > > — > You are receiving this because you commented. > Reply to this email directly, view it on GitHub > <https://github.com/asciinema/asciinema/issues/160#issuecomment-301712433>, > or mute the thread > <https://github.com/notifications/unsubscribe-auth/AG43M6dRcLL9t5y-22nTwG0rcEtJcdfuks5r6V5IgaJpZM4In9vV> > . >
Author
Owner

@ku1ik commented on GitHub (May 23, 2017):

Looks like they're not enough indeed :)

<!-- gh-comment-id:303504036 --> @ku1ik commented on GitHub (May 23, 2017): Looks like they're not enough indeed :)
Author
Owner

@just4t commented on GitHub (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
<!-- gh-comment-id:403337554 --> @just4t commented on GitHub (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 ```
Author
Owner

@just4t commented on GitHub (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!

<!-- gh-comment-id:403800855 --> @just4t commented on GitHub (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 in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/asciinema#738
No description provided.