Bon día:
Albert Astals Cid va escriure:
Hmm, no acabo de entedre perquè però segons la gent
del glibc per defecte
s'ometen els . al fer comparacions de cadenes de caràcters. Alguna idea?
Sí. Els comparacions de cadenes "segons el locale" estan fetes amb l'idea
de construir repertoris telefónics (les pàgines blanques). Amb eixe punt de
vista,
entendràs el per què de considerar les punts com "auxiliars", es dir, no
tant
important com podràn ser les lletres mateixes.
Si et pareix comparar paraules, es dir, en el teu cas, comparar unit
contra unitdescriptor i desprès cpp contra h, tens primer que segar les
linees
en dos camps distincts, i comparar els camps un darrere l'altre (si el
primer
resulta igual, comparem el segon; sino, ni es mira).
Altra manera de fer, que al millor es pot resultar més senzill i eficient,
és de
gastar "tailoring"; per això es fa servir la eina localedef. Li tens que dir
que el
punt (i supone els altres signes de punctuació) et resulta més important que
la
comparació de les lletres.
Si amb la versió actual del localedef (crec que està inclos en glibc) no et
permitix
declarar un "collating-element" de més pes que les lletres (fora de
redefinir tota la
col·lació), serà una bona idea de afegir-ho com nova funcionalitat (no sé si
s'ha
considerat en la ISO 14651). També busca per "reorder-after", no és la
solució
del teu problema, però et pot donar pistes per resoldre'l.
Una persona que sab molt del tema i que et contestarà és Keld Simonsen,
<keld(a)dkuug.dk>dk>. Ves amb cuidà amb lo que et diga, de vegades et dirà coses
que son exagerades.
Antoine Leca