Unicode support in JRuby
I've been playing quite a lot with JRuby recently, reading its sources, writing cool scripts in it (I'm gonna post some here soon) and asking for help on JRuby developers mailing list. The reason why I needed to ask for help was a problem with Unicode support which I encountered: whenever I tried to pass a string with some Unicode characters across the Java-JRuby boundary (in either way), the characters got scrambled. Thus I couldn't even pass a Unicode string which I'd received from some Java method into the other method, the code
java.lang.System.out.println my_java_object.get_some_string()
would have printed a string of the characters with everything except the lowest byte discarded.
Once I figured out the most common scenarios of JRuby usage which could require the Unicode support, I decided to write a message to the JRuby interest alias (although my questions were redirected to the developers mailing list soon after that). After a couple of messages Charles decided to fix a problem, and now we have a working (although far from complete) Unicode support in JRuby trunk, see a recent blog post of Charles. Of course, Unicode support needs more work, and before Ruby 2.0 it is tricky to do the things in such a way that they don't get obsolete in future. But now, the major problem is fixed: after I'd updated my JRuby from SVN, passing Unicode strings back and forth between JRuby and Java started to work correctly. That means that I can use all the Java Unicode support methods straight from JRuby.
One thing which I really like about this, is how quickly the problem was resolved. And if you find that you have some major problem with JRuby, don't hesitate to ask to fix it (and don't forget to tell, how you'd prefer it to work when fixed) — feedback is very important for the developers, who love the product they are working on, and they'd love to help you resolve the problem.