Le 01/06/2020 à 20:51, Miguel Figueiredo a écrit :

I suspect /usr/share/X11/locale/C was missing and not related with en_US, which is not needed - see screenshot from the locales directory on a new installation with only Portuguese files.

Let me know if /usr/share/X11/locale/C is present.


Hello,

Thanks for your testing and response.

To answer your question, yes the "C" directory is present

  $ ls /usr/share/X11/locale/C/
  Compose  XI18N_OBJS  XLC_LOCALE

I believe the problem is with how X11 supports UTF-8.

Running dmenu through strace with LANG set to fr_FR.UTF-8 shows that it tries to use en_US.UTF-8 and fails

  openat(AT_FDCWD, "/usr/share/X11/locale/locale.dir", O_RDONLY) = 3
access("/usr/share/X11/locale/en_US.UTF-8/XLC_LOCALE", R_OK) = -1 ENOENT (Aucun fichier ou dossier de ce type)

The file /usr/share/X11/locale/locale.dir points the locale name at the locale database file name
In this file a comment states that the support is incomplete

  # Note: The UTF-8 locales don't work correctly yet. Work in progress.

Luckily Portuguese is correctly supported which explain why your test worked

  $ grep pt_PT.UTF-8 /usr/share/X11/locale/locale.dir
  pt_PT.UTF-8/XLC_LOCALE                        pt_PT.UTF-8
  pt_PT.UTF-8/XLC_LOCALE:                       pt_PT.UTF-8

Indeed the locale database exists in libx11-data

  $ dpkg-deb -c libx11-data_2%3a1.6.9-2_all.deb |grep pt_PT
drwxr-xr-x root/root 0 2020-02-26 17:40 ./usr/share/X11/locale/pt_PT.UTF-8/ -rw-r--r-- root/root 237 2020-02-26 17:40 ./usr/share/X11/locale/pt_PT.UTF-8/Compose -rw-r--r-- root/root 345 2020-02-26 17:40 ./usr/share/X11/locale/pt_PT.UTF-8/XI18N_OBJS -rw-r--r-- root/root 2064 2020-02-26 17:40 ./usr/share/X11/locale/pt_PT.UTF-8/XLC_LOCALE

OTOH fr_FR.UTF-8 has no database and points at the US locale

  $ grep fr_FR.UTF-8 /usr/share/X11/locale/locale.dir
  en_US.UTF-8/XLC_LOCALE                        fr_FR.UTF-8
  en_US.UTF-8/XLC_LOCALE:                       fr_FR.UTF-8

  $ dpkg-deb -c libx11-data_2%3a1.6.9-2_all.deb |grep fr_FR.UTF-8

Same for Basque eu_ES.UTF-8 as reported by Martintxo

  $ grep eu_ES.UTF-8  /usr/share/X11/locale/locale.dir
  en_US.UTF-8/XLC_LOCALE                        eu_ES.UTF-8
  en_US.UTF-8/XLC_LOCALE:                       eu_ES.UTF-8
  $ dpkg-deb -c libx11-data_2%3a1.6.9-2_all.deb |grep eu_ES.UTF-8

Test of dmenu (LANG=fr_FR.UTF-8) with and w/o en_US.UTF-8 locale directory

  $ echo $LANG
  fr_FR.UTF-8
  $ echo -e 'One\nTwo\nThree' |  dmenu
  Two
$ sudo mv /usr/share/X11/locale/en_US.UTF-8 /usr/share/X11/locale/en_US.UTF-8.bkup
  $ echo -e 'One\nTwo\nThree' |  dmenu
  warning: no locale support
  warning: no locale modifiers support
  Erreur de segmentation

So it seems that en_US.UTF-8 should be treated as "C" by localepurge wrt UTF-8 to be safe

Thanks!

Reply via email to