common icon indicating copy to clipboard operation
common copied to clipboard

Set neutral locale (C) when running package manager or version commands

Open afbjorklund opened this issue 11 months ago • 2 comments

Some of the output is locale-specific, which might affect the parsing (or scraping)

en_US

Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name           Version      Architecture Description
+++-==============-============-============-=============================================

sv_SE

Önskat=Okänd(U)/Installera(I)/Radera(R)/Rensa(P)/Håll(H)
| Status.=Ej inst.(N)/(I)nst./Konffil.(C)/(U)ppack./Halvkonf.(F)/(H)alvinst.
| /       Vänt.utl(W)/Föresl.utl(T)
|/ Fel?Inget(=)/Ominstallera(R)/Båda(X) (Status,Fel: versaler=illa)
||/ Namn           Version      Arkitektur   Beskrivning
+++-==============-============-============-=============================================

So it should probably run the commands with LC_ALL=C in the environment


Noticed by user with Arch Linux with a german locale, in https://github.com/containers/podman/discussions/22148.

    package: /usr/bin/pasta ist in passt 2024_03_20.71dd405-1 enthalten

afbjorklund avatar Mar 24 '24 17:03 afbjorklund

Better to use LC_ALL=C.UTF-8 which is something that most Linux distributions should be shipping with these days.

Foxboron avatar Mar 25 '24 11:03 Foxboron

The package names and versions are ASCII anyway, so the encoding doesn't really matter (only the language used)

afbjorklund avatar Mar 25 '24 15:03 afbjorklund