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

locale on musl libc library is not working #39673

Closed
nniixxoossccnn opened this issue Apr 18, 2020 · 6 comments
Closed

locale on musl libc library is not working #39673

nniixxoossccnn opened this issue Apr 18, 2020 · 6 comments
Labels
<Bug> This needs to be fixed OS: Linux Issues related to Linux operating system (S2 - Confirmed) Bug that's been confirmed to exist (S4 - Invalid) wontfix / can't reproduce / notabug Translation I18n

Comments

@nniixxoossccnn
Copy link

Game version: 0.E (stable)

Operating system: Alpine Linux 3.11

Tiles or curses: curses

Mods active:

Expected behavior

It can display Chinese correctly

Actual behavior

It is not displayed correctly

Steps to reproduce the behavior

this is my command to compile and install:


OPTS="RELEASE=1 LOCALIZE=1 USE_HOME_DIR=1 ASTYLE=1 PREFIX=/usr BACKTRACE=0 CCACHE=1"


make ${OPTS} || exit 1


make localization LANGUAGES="zh_CN zh_TW" ${OPTS} || exit 1


mkdir -pv ${PKG_DIR}/usr/share/locale || exit 1
cp -r ./lang/mo/* ${PKG_DIR}/usr/share/locale/ || exit 1

make ${OPTS} DESTDIR=${PKG_DIR} install || exit 1

When I run cataclysmdda, its multilingual display is like the LANG variable is not set correctly on Glibc

I saw it at the moment of starting:

You don't seem to have a valid Unicode locale. You may see some weird characters warned.empty boxes or question marks). You have been
@Qrox
Copy link
Contributor

Qrox commented Apr 18, 2020

This also happens on MSYS2, but I'm not sure why it's happening.

@ymber ymber added (S1 - Need confirmation) Report waiting on confirmation of reproducibility <Bug> This needs to be fixed OS: Linux Issues related to Linux operating system Translation I18n labels Apr 21, 2020
@BrettDong

This comment has been minimized.

@BrettDong

This comment has been minimized.

@anothersimulacrum anothersimulacrum added (S2 - Confirmed) Bug that's been confirmed to exist and removed (S1 - Need confirmation) Report waiting on confirmation of reproducibility labels Nov 29, 2020
@BrettDong

This comment has been minimized.

@BrettDong BrettDong self-assigned this Nov 29, 2020
@BrettDong
Copy link
Member

Seems libstdc++ only supports C locale with non-glibc:
https://www.openwall.com/lists/musl/2020/11/30/6

So I think there is nothing we can do to fix this issue.

@BrettDong BrettDong removed their assignment Nov 30, 2020
@BrettDong BrettDong added the (S4 - Invalid) wontfix / can't reproduce / notabug label Nov 30, 2020
@BrettDong
Copy link
Member

Just received a solution from musl mailing list so I write it down here for your reference:

  1. Patch GCC with https://github.com/smaeul/portage/blob/c744774a/patches/sys-devel/gcc/gcc-5.4.0-locale.patch, line numbers may differ for newer GCC versions nowadays, anyway the patch is essentially removing the following lines in function locale::facet::_S_create_c_locale(...) in libstdc++-v3/config/locale/generic/c_locale.cc:
if (strcmp(__s, "C"))
      __throw_runtime_error(__N("locale::facet::_S_create_c_locale "
			    "name not valid"));
  1. Build Cataclysm DDA with the patched libstdc++, for me I installed the patched GCC in /opt/gcc so my build command is LDFLAGS='-L/opt/gcc/lib64 -Wl,-rpath=/opt/gcc/lib64' make LOCALIZE=1 NATIVE=linux64 BACKTRACE=0 GOLD=1 RELEASE=1

  2. Run Cataclysm DDA with LANG=zh_CN.UTF-8 ./cataclysm and, Hooray!

螢幕截圖 2020-12-01 11 47 14

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
<Bug> This needs to be fixed OS: Linux Issues related to Linux operating system (S2 - Confirmed) Bug that's been confirmed to exist (S4 - Invalid) wontfix / can't reproduce / notabug Translation I18n
Projects
None yet
Development

No branches or pull requests

5 participants