Roberto
Roberto

Reputation: 1089

Upper or lower case string

Today in my system any user can "store a string" the way he want. but now when ill use sphinx for example, the facets returns two or more same city for example, cause have a number of ways stored in the db, like Curitiba CURitiba CURITIBA etc.

I want to fix the problem letting all string in my system store in a pattern.

My question is, which is the best way, store in upper or lower case?

Upvotes: 1

Views: 456

Answers (4)

Daniel DiPaolo
Daniel DiPaolo

Reputation: 56438

If the data comes from somewhere else, then you should store it however you receive it and that would then be the canonical casing, though all comparisons/searches/etc. would be case-insensitive.

For example, if it's for user input and a user inputs Roberto, then store Roberto but you can still match on ROBerto, ROBERTO, roberto, etc.

Upvotes: 2

Carlos Quintanilla
Carlos Quintanilla

Reputation: 13343

I would say lowercase, then you can apply a capitalize later on.

Upvotes: 0

Brian Hoover
Brian Hoover

Reputation: 7991

Personally, I like lower case, but simply because users tend to consider upper case to be shouting.

I don't think there's any technical difference between the two.

Upvotes: 0

Igor
Igor

Reputation: 34021

Does not matter really, as long as you are consistent.

Upvotes: 0

Related Questions