Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

Re: Handling caps for surnames with capitals in the middle (was: Irish Surnames)

by Sidhekin (Priest)
on May 06, 2002 at 12:12 UTC ( [id://164299]=note: print w/replies, xml ) Need Help??


in reply to Handling caps for surnames with capitals in the middle (was: Irish Surnames)

Anyway, does anyone have any suggestions on how to handle the above names.

The best way to handle this problem is to not throw away information, but rather store the name with correct case.

Just like the Y2k-problem, it is trivial to store correctly in the first place and non-trivial to restore the correct data after information (century or case) has been thrown away. And if you should ever need the simpler form (for presentation as two-digit year or for case-insensitive sorting of names), it is easier by far to produce from the correct form than the other way around.

I guess everybody knew it, but I felt somebody ought to say it :-\

The Sidhekin
print "Just another Perl ${\(trickster and hacker)},"

Replies are listed 'Best First'.
Re: Re: Handling caps for surnames with capitals in the middle (was: Irish Surnames)
by derby (Abbot) on May 06, 2002 at 12:59 UTC
    This is the way I would do it also. Store the data exactly as the user enters it (or supplies it). Then use either functional indexes if your back-end supports it or add another field that is the canonacalized version (all lower, all upper, stripped of spaces, etc).

    -derby

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://164299]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others lurking in the Monastery: (4)
As of 2024-03-28 13:48 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found