[mythtv-users] MythVideo: file name sorting oddity

Anduin Withers awithers at anduin.com
Thu Dec 13 03:43:14 UTC 2007


> I guess I'm confused as to why the en_US locale is (to me) screwed up in
> the way it orders files/titles.  Is there somewhere I can visit to
> expound upon that point?

Many places, there was much written about it when various distributions
started moving away from a default C locale to things like en_US and
en_US.utf8.

This may be a good argument for comparing filenames, when sorting, without
their extensions. This issue is similar to the brokenness of title compares
in -fixes where what is being compared may not be obvious (in the titles
case not only is it not obvious but it can be wrong).

> It doesn't make sense for me to use the C locale when en_US is the
> correct locale, but at the same time my locale doesn't appear to make
> any sense in the way it does ordering.

Sorting sucks. As for it making sense, sort T. S. Elliot and Trotsky. Did
you compare r to . or S? The example is contrived but if you look at the
confused sorting you currently see and pretend you skip the . before the
extension it makes sense.

> If need by I'll compile MythVideo myself and modify the SQL, but that
> seems extreme and (should be) unnecessary.

SQL collate isn't used in MythVideo, the code is in videofilter.cpp
VideoFilterSettings::meta_less_than().

> [test in another e-mail where collation and ls don't work]

I don't Ubuntu, but ls should be honoring your locale setting (ls
--sort=none should confirm it normally sorts).

-- 
Anduin Withers



More information about the mythtv-users mailing list