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

rpmbuild: default to LANG=C.utf8 ? #2587

Closed
juhp opened this issue Jul 28, 2023 · 5 comments · Fixed by #2616
Closed

rpmbuild: default to LANG=C.utf8 ? #2587

juhp opened this issue Jul 28, 2023 · 5 comments · Fixed by #2616
Assignees

Comments

@juhp
Copy link

juhp commented Jul 28, 2023

It is not unusual for software to require UTF-8 encoding to build these days.

It seems rpmbuild still defaults to LANG=C nowadays.
I think most platforms support LANG=C.UTF-8 now, so could the default be changed?
At least for platforms like Linux where it is available?

For example I think mock already defaults to C.utf8 for quite some time.

@Conan-Kudo
Copy link
Member

For what it's worth, I think we should at least consider making a build flag to switch RPM to use C.UTF-8 instead of C, and make our CMake default to it for Linux.

From my research, it seems that Darwin/macOS does the "interesting" thing of overlaying UTF-8 support to the C locale by doing the following combination: LANG=C + LC_CTYPE=UTF-8. It's not wrong, but I don't think anyone else does it.

FreeBSD has had a C.UTF-8 locale for a while, but with FreeBSD 13, it is now the default: freebsd/freebsd-src@09ef995

OpenBSD has supported C.UTF-8 in some form for at least ten years, and NetBSD's C locale is UTF-8 aware (and C.UTF-8 is an alias to C there).

So at least at this point, the only odd duck is macOS.

@gotmax23
Copy link
Contributor

The current rpm version doesn't build on MacOS to begin with according to #2222, so I don't think that should be a consideration here.

@Conan-Kudo
Copy link
Member

We shouldn't make the problem worse, and there are plenty of people using RPM on macOS for various reasons. We will have support for it one way or another.

@keszybz
Copy link
Contributor

keszybz commented Aug 4, 2023

Please default to C.UTF-8, this is generally correct setting. An option can be provided to override for the fringe cases that need it.

pmatilai added a commit to pmatilai/rpm that referenced this issue Aug 15, 2023
Mostly everything around us is UTF-8 these days, we need to get on with
the times. Especially now that glibc >= 2.35 finally supports it too.
Attempt to detect C.UTF-8 availability in cmake and prefer when available,
fall back to C when not.

Fixes: rpm-software-management#2587
@pmatilai pmatilai self-assigned this Aug 15, 2023
pmatilai added a commit to pmatilai/rpm that referenced this issue Aug 23, 2023
Mostly everything around us is UTF-8 these days, we need to get on with
the times. Especially now that glibc >= 2.35 finally supports it too.
Default to C.UTF-8 but allow disabling it via cmake option to fallback
to the traditional C locale instead.

Fixes: rpm-software-management#2587
pmatilai added a commit that referenced this issue Aug 23, 2023
Mostly everything around us is UTF-8 these days, we need to get on with
the times. Especially now that glibc >= 2.35 finally supports it too.
Default to C.UTF-8 but allow disabling it via cmake option to fallback
to the traditional C locale instead.

Fixes: #2587
@juhp
Copy link
Author

juhp commented Aug 25, 2023

Thank you, great news!

dmnks pushed a commit to dmnks/rpm that referenced this issue Sep 1, 2023
Mostly everything around us is UTF-8 these days, we need to get on with
the times. Especially now that glibc >= 2.35 finally supports it too.
Default to C.UTF-8 but allow disabling it via cmake option to fallback
to the traditional C locale instead.

Fixes: rpm-software-management#2587
(cherry picked from commit 3be76d7)
dmnks pushed a commit to dmnks/rpm that referenced this issue Sep 4, 2023
Mostly everything around us is UTF-8 these days, we need to get on with
the times. Especially now that glibc >= 2.35 finally supports it too.
Default to C.UTF-8 but allow disabling it via cmake option to fallback
to the traditional C locale instead.

Fixes: rpm-software-management#2587
(cherry picked from commit 3be76d7)
dmnks pushed a commit that referenced this issue Sep 4, 2023
Mostly everything around us is UTF-8 these days, we need to get on with
the times. Especially now that glibc >= 2.35 finally supports it too.
Default to C.UTF-8 but allow disabling it via cmake option to fallback
to the traditional C locale instead.

Fixes: #2587
(cherry picked from commit 3be76d7)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
5 participants