1

Disclaimer: I am aware this is advanced stuff, "off the beaten track, and could blow up my system, cause a rain of frogs, or have unknowable strange unpredictable side effects. That said..... assistance anyway please :) I promise I won't hold anyone responsible :)

Simple version, I want to modify my FreeBSD server's charset sort order so that underscore is ranked systemwide before letters and numbers in alphabetic order, not between upper/lowercase (underscore falls between 'XYZ' and 'abc' in ASCII/Unicode).

The reason is that for about 20 years I've put all the files and dirs. that are "important" with varying numbers of underscores at the start, to force them to the top of the list in Windows and its predecessors (which sort symbols -> numbers -> letters at least as far as non-Unicode goes). On that background it's immensely disconcerting to have now at the bottom. Disconcerting enough that I'd like to change my FreeBSD server's charset sort order the tiniest bit, just to get underscore before alphanumeric not after it.

I can't think that anything critical would be predicated on this in the system or common software (especially as other languages have different sort orders), and I don't need to change any other character orderings.

I've got as far as LC_COLLATE, locale and colldef, and from man colldef and a skim through FreeBSD source comments, I gather that the file(s) I need are generated by a tool in the FreeBSD source, based on data from Unicode Inc (possibly also modified or augmented by other controlling files in the FreeBSD source.

I imagine it involves customising the standard human-readable definitions, then using the build tools to build a custom locale, which duplicates all existing files but includes changes to the collate definitions.

I haven't got beyond that so far, and would like clarity on the process by which FreeBSD's build system gets from whatever human-editable source files are involved, to the final collation definition data files used in a running system for locale charset ordering/comparison functions. Specifically, what steps I would have to do, to do this.

As a side benefit I expect to learn a lot by doing it - but above all I want my underscores where I'm so used to them...

Stilez
  • 1,261
  • See /etc/profile, man login.conf, man setlocale and /usr/share/locale/*. Also the Handbook. – Rob Feb 11 '18 at 12:15
  • 1
    A related Q&A, dealing in the fact that different locales handle underscore differently, is https://unix.stackexchange.com/questions/35469/ . – JdeBP Sep 26 '18 at 08:32
  • @JdeBP this info was incredibly helpful, hadn't heard of LC_COLLATE, exploring to see how far that takes me. In case it's useful to anyone else, searching for that, led me to some other useful questions and info pages: https://unix.stackexchange.com/questions/75341/specify-the-sort-order-with-lc-collate-so-lowercase-is-before-uppercase https://unix.stackexchange.com/questions/15980/does-should-lc-collate-affect-character-ranges https://superuser.com/questions/862292/is-there-a-unicode-aware-lc-collate-sort-order-which-respects-punctuation and other questions found by searching for LC_COLLATE. – Stilez Sep 26 '18 at 12:47

0 Answers0