Skip to content

Titlecase has a different behavior than Rails #8

Description

@lucianot

I substituted the Rails titlecase method for UnicodeUtils::titlecase, because of UTF-8 characters. I noticed the behavior is not exactly the same, even when no special chars are involved. For example:

Capitalized letter within word:

> "CompanyName".titlecase
 => "Company Name"
> UnicodeUtils.titlecase "CompanyName"
 => "Companyname"

Words than contain periods:

> "Company X.Y.Z.".titlecase
 => "Company X.Y.Z."
> UnicodeUtils.titlecase "Company X.Y.Z."
 => "Company X.y.z."

Is this intentional for some reason? It would be interesting if unicode_utils preserved the original behavior and dealt only with the special chars.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions