TitleIze seems to be breaking on non-ascii characters.
There's a version of Titleize that appears to work for multibyte
character sets.
http://apidock.com/rails/ActiveSupport/Multibyte/Chars/titleize
Second option is to cross reference against a database of surnames, if
you can find one.
Third option would be to use the Google Search (not suggest) API. Get
the first reply, search for the name in the uncapitalized reply, use the
capitalization as per the text on the webpage.
Fourth option would be to offer users the facility to fix their own data.
Ian Moss wrote:
Quick question on internationalisation. Well, converting of name
strings into a useable format.
I working on the MEP Connect project at the moment.
I've a bunch of names, where the surname is capitalized. No problem I
thought, I'll downcase.titleize the string.
However, the output is a little bit of a mess, with some characters
remaining uppercase - perhaps this is why the EU left them all
uppercase? Who knows.
--
Sean Bamforth
p: +44 (0)7802 653722
w: http://threeparams.com
e: [email protected]
--
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.