On Tue, Mar 03, 2015 at 11:41:07PM +0100, Thomas Bohl wrote:
> Thank you very much! Colorls still showed me ?? for the majority of
> characters. This patch works as expected.

I'm not sure what kind of behaviour you expect.

colorls showing some ?? indicates that the character set used by
filenames and your locale character set configuration do not match.
See http://www.openbsd.org/faq/faq10.html#locales in case you
didn't set up your locale yet. Set your locale's charset to
the charset used by your filenames. Then try colorls again.
If charsets align, it should just work.

In case you have mixed charsets in filenames which then causes ?? this
is very hard to deal with in any case. In this situation you could
pkg_add convmv and use that tool to straighten out filename charsets.

Perhaps tedu's diff is a good idea, perhaps not.
Making ls(1) aware of character encodings has some advantages (e.g.
multi-column output always aligns properly) and some disadvantages
(need to set up the locale first, can only use one charset at a time).
Just allowing any garbage might sometimes make things appear to
work as if by magic, but could also corrupt your terminal or worse.
Then again, ls probably shouldn't be in the business of compensating
for bugs in terminal emulators. I suspect many other tools aren't,
either (e.g. df(1) doesn't care).

Reply via email to