String#upcase and downcase fail for multibyte characters #439

Closed
headius opened this Issue Dec 12, 2012 · 3 comments

Projects

None yet

2 participants

@headius
Member
headius commented Dec 12, 2012

Evidence:

system ~/projects/jruby $ jruby -e "p 'FØØ'.downcase"
"fØØ"

system ~/projects/jruby $ jruby -e "p 'føø'.upcase"
"Føø"

A crappy workaround for now would be str.to_java.to_upper_case.

@keynmol
keynmol commented Dec 12, 2012

Fortunately, UnicodeUtils gem works in JRuby, but dragging a whole gem for such miniscule task seems inappropriate.

So UnicodeUtils.downcase(str) looks a bit like crap, but it's a workaround nontheless.

@headius
Member
headius commented Dec 12, 2012

Actually it appears that MRI does not case fold these characters either, so I'm closing this.

@headius headius closed this Dec 12, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment