A JRuby compatible encoding example