Fails to recognize UTF-8 locale

Bug #1830051 reported by Egmont Koblinger
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
snapd
Confirmed
Low
Unassigned

Bug Description

Forwarding from https://askubuntu.com/q/1144804/398785

The command "LC_ALL=en_IN.UTF-8 snap list" (assuming the terminal is set to UTF-8) prints green ticks in the "Publisher" column, as expected.

The command "LC_ALL=en_IN snap list" prints green asterisks instead. Expected: green ticks, just as before.

Both locales are UTF-8, as confirmed for the latter one by "LC_ALL=en_IN locale charmap"

I assume UTF-8 support is detected by searching for the substring "UTF-8" in the locale related environment variables, which is bad practice.

In order to detect UTF-8, the equivalent of the "locale charmap" command should be executed, that is, setlocale(...) followed by nl_langinfo(CODESET).

snapd version 2.38+19.04 on Ubuntu 19.04.

Revision history for this message
Egmont Koblinger (egmont-gmail) wrote :

See also bug 1830052 for a related issue.

Revision history for this message
John Lenton (chipaca) wrote :

I agree this is a bug. cost/benefit-wise though it doesn't make sense for us to fix it... getting nl_langinfo to work properly everywhere would be a nightmare, even if it were already in Go.

Changed in snappy:
status: New → Confirmed
importance: Undecided → Low
Revision history for this message
John Lenton (chipaca) wrote :

(as a workaround note that --unicode=always works)

Michael Vogt (mvo)
affects: snappy → snapd
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.