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

'en_US.UTF-8' locale error in Termux #507

Open
matte22ladde opened this issue Sep 24, 2024 · 6 comments
Open

'en_US.UTF-8' locale error in Termux #507

matte22ladde opened this issue Sep 24, 2024 · 6 comments
Labels
compatibility External Problem/Bug Problems/Bugs of other projects

Comments

@matte22ladde
Copy link

matte22ladde commented Sep 24, 2024

ble version: 0.4.0-devel4+32f290d
Bash version: 5.2.32(1)-release (aarch64-unknown-linux-android)

ble.sh: The locale 'en_US.UTF-8' (LC_CTYPE) seems broken. Please check that the locale exists in the system.

@akinomyoga
Copy link
Owner

Please check that the locale exists in the system. What are the results of the following commands?

$ locale
$ locale -a | grep en_US

I started to check the locale in commit 537c650 since broken system locales turned out to cause problems.

@akinomyoga akinomyoga added External Problem/Bug Problems/Bugs of other projects question Question / Mis-usage and removed External Problem/Bug Problems/Bugs of other projects labels Sep 24, 2024
@matte22ladde
Copy link
Author

matte22ladde commented Sep 25, 2024

No command locale found, did you mean:
 Command locate in package mlocate

@akinomyoga
Copy link
Owner

No, I didn't mean locate. locale is one of the standard utilities required by POSIX.

@matte22ladde
Copy link
Author

pkg list-all | grep locale

WARNING: apt does not have a stable CLI interface. Use with caution in scripts.

[ble: exit 1]

@akinomyoga akinomyoga added compatibility External Problem/Bug Problems/Bugs of other projects and removed question Question / Mis-usage labels Sep 25, 2024
@akinomyoga
Copy link
Owner

akinomyoga commented Sep 25, 2024

If you want to search the package that provides the command locale, pkg list-all is not the right command. It only prints the names of packages. Since it is a part of the basic utilities, I don't think the package that contains locale would have the name locale. After some searching, pkg doesn't seem to provide a way to search for a file in packages that haven't been installed. Instead, it seems one can install and use apt-file. The correct way seems this:

$ pkg install apt-file
$ apt-file search /locale | grep 'locale$'

However, it turned out no package provides the command locale in the Termux repository. The above command only lists a file that is not a command.


I confirmed the problem in my Android using Termux. Surprisingly, it seems the C locale doesn't work in Termux while LANG=en_US.UTF-8 works. The following discussion says that Termux actually doesn't support C locale:

I found another thread that seems to imply that one can set up a locale in a Termux environment:

The first thread talked about dpkg-reconfigure and /etc/envrionment, but I don't find them in my Termux environment. The second thread seems to imply that those locales are only available with proot-distro, which doesn't seem to be the default package management of Termux.

ble.sh haven't been assuming the environments that don't support the most basic locale C, (though it assumes the opposite case where only the C locale is available). This implies that many places in the codebase can be potentially broken in Termux. I need to investigate the impact.

@akinomyoga
Copy link
Owner

I'll later investigate the impact and fix the relevant parts, which can be affected by the non-working C locale.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compatibility External Problem/Bug Problems/Bugs of other projects
Projects
None yet
Development

No branches or pull requests

2 participants