Questions tagged [case-insensitivity]

6 questions
10
votes
5 answers

How do you fix the wrong-case-sensitivity dictionary setting bug-pattern?

There is a coding anti-pattern I've noticed (while using .Net). You declare a data class, which is supposed to have a dictionary field (or get/set Property), and lets call it 'Properties', for the sake of example. It has a string key type. …
9
votes
6 answers

What are the pros and cons of having a CaseInsensitiveString type in Java?

I'm tempted to create a final class CaseInsensitiveString implements CharSequence. This would allow us to define variables and fields of this type, instead of using a regular String. We can also have e.g. a Map, a…
9
votes
3 answers

Programming around email address case sensitivity

Like many websites, we use email addresses as user identifiers for logins. RFC 5321 [#2.3.11] states that the local parts of email addresses: MUST be interpreted and assigned semantics only by the host specified in the domain part of the…
Gareth
  • 5,092
  • 1
  • 17
  • 13
1
vote
1 answer

pcre case insensitivity: handle escape sequences as raw bytes?

Consider the following regex (no unicode): Example:\x04\x05\x41 Suppose you search this regex case-insensitively. Would you expect it to search the final \x41 in case-sensitive manner? People whom I ask actually expect such behavior. And such…
Muxecoid
  • 111
  • 5
0
votes
1 answer

Static analysis for finding capitalisation / case inconsistencies in file names

TLDR; I'm looking for ideas on how to flag code containing file names/paths that have inconsistent capitalisation with the actual file/directory. Situation I am migrating a significant code base written in an interpreted language from a Windows/OSX…
thexacre
  • 1,155
  • 8
  • 11
-4
votes
1 answer

What happen to string.ToCommonSenseCase()?

I'm very confused about this. In most programming languages, there are string.ToUpperCase(), string.ToLowerCase(), sometimes Capitalize() (which capitalize the first letter of the string), even ToTitleCase() which capitalize every first letter of…
AVAVT
  • 111
  • 3