Created attachment 208599 [details]
Demonstrate the problem
Depending on $LANG, the value printed for the STARTED column may be an empty string (or a sequence of blanks?)
Attached is a simple shell script listing both the broken and the Ok locales.
Looks like the UTF-8, US-ASCII, ISO8859-1 and ISO8859-15 are all fine, while most others (like my own uk_UA.KOI8-U) are broken...
Apparently the problem isn't in ps itself and rather in libxo which talks about locales in general, but then uses a lot of handrolled conversions that apply only to ascii/utf-8. I'll look into it if no one beats me to it.
It turned out to be not as bad as I thought, I'll try proposing a patch upstream:
Please check if it fixes the issue for you.
*** Bug 229453 has been marked as a duplicate of this bug. ***
*** Bug 230068 has been marked as a duplicate of this bug. ***
A commit references this bug:
Date: Sun Jun 7 08:21:20 UTC 2020
New revision: 361887
ps: use %hs instead of %s format specifiers
Use %hs (locale-based encoding) instead of %s (UTF-8) format for
strings that are expected to be in current locale encoding (date/time,
process names/argument list).
Reviewed by: phil
Differential Revision: https://reviews.freebsd.org/D22160