Hi guys This has been a problem since pussy was a cat ...
I remember trying to write a function for Oracle PL/SQL that would do Mc and Mac names correctly ... except some people don't do them camel case and there's no way of finding out without letting them just enter the data. Even if you look them up you might find that the particular family has chosen to capitalise differently from the "norm". Haven't tried downcase in Postgres (or if you must MySQL). Probably does it "right" for the character set the DB was created in. I bet the people who created the original database had the same discussion and went for upper case. On Wed, Aug 10, 2016 at 2:37 PM, Matt Wildig <[email protected]> wrote: > Others have mentioned that automatically processing names this way is > probably a bad idea, but I think it’s interesting to note that this > behaviour is something that is going to change in the next release of Ruby > (2.4). > > Currently, the Ruby string methods such as upcase, downcase, strip etc. > only work on ASCII characters; others are left unchanged. This is the root > cause of the issue you are having: > > #Ruby 2.3.1 > "BJÖRK".downcase #=> "bjÖrk" > > But in Ruby 2.4.0.preview1 this works as expected (as do the other String > methods): > > "BJÖRK".downcase #=> "björk" > > Currently, with Rails, you can use mb_chars to achieve the same result: > > "BJÖRK".mb_chars.downcase.to_s #=> "björk" > > (I still don’t think you should use this on names though.) > > > Matt > > -- > You received this message because you are subscribed to the Google Groups > "North West Ruby User Group (NWRUG)" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To post to this group, send an email to [email protected]. > > Visit this group at https://groups.google.com/group/nwrug-members. > For more options, visit https://groups.google.com/d/optout. > -- Thanks and Regards, Francis 07764 225 942 "So when targets seem stupid, arbitrary and unfair it's because they *are*. The only way to improve is to look at the whole system people are operating with, the basic tools, their training, how much initiative they are allowed, are you measuring the right things (more about that later) and then you can improve. But it's the *system* you improve, not the people you beat into performing even worse." Unicorns in the mist <https://leanpub.com/unicorns> CV http://www.pharmarketeer.com/francis.html Lean Teams Consultancy -- You received this message because you are subscribed to the Google Groups "North West Ruby User Group (NWRUG)" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send an email to [email protected]. Visit this group at https://groups.google.com/group/nwrug-members. For more options, visit https://groups.google.com/d/optout.
