开发者

Rails titlecase doesn't work on non-english letters

I'm trying to use title开发者_开发百科case to change an all uppercase words to nicer output. It works with non english letters but not on other letters. Is there any similar more UTF-8 friendly command?

"#{self.name.titlecase}"

Results:  SkjÖldÓlfsstaÐi

Johann


This should work on unicode characters:

"SkjÖldÓlfsstaÐi".mb_chars.titlecase.to_s

Results: Skjöldólfsstaði

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜