JRuby

Base64Coder#encode(String) has a problem.

Details

  • Testcase included:
    yes
  • Number of attachments :
    2

Description

・Base64Coder#encode(String) use "String#getBytes()"
・affected from environment (ex. my japanese env)
・Base64Coder#encode(String) is not used (from other java source code).

therefore, i think

・parameter encoding can be specified. [with patch]

or

・remove Base64Coder#encode(String)

thanks

kennyj

Activity

Hide
Charles Oliver Nutter added a comment -

Are you providing this patch simply because you want to use Base64Coder? I believe it may be used in other libraries, perhaps we could just add the method you are looking for?

Show
Charles Oliver Nutter added a comment - Are you providing this patch simply because you want to use Base64Coder? I believe it may be used in other libraries, perhaps we could just add the method you are looking for?
Hide
kennyj added a comment -

#sorry, my poor english

No. Because,

・String#getBytes() is affected by environment(because this method use "default encoding")
・I looked for "where call String#getBytes()", when i had file upload problem (JRUBY-1206)

  1. i think we should not use String#getBytes()
    ・Base64Coder used String#getBytes()
    ・No one used it. (in commited sources)
     sorry, It was not thought. "not commited sources"
Show
kennyj added a comment - #sorry, my poor english No. Because, ・String#getBytes() is affected by environment(because this method use "default encoding") ・I looked for "where call String#getBytes()", when i had file upload problem (JRUBY-1206)
  1. i think we should not use String#getBytes() ・Base64Coder used String#getBytes() ・No one used it. (in commited sources)  sorry, It was not thought. "not commited sources"
Hide
Ola Bini added a comment -

It's more correct to always do getBytes("ISO-8859-1") in this case. The fix has been committed.

Show
Ola Bini added a comment - It's more correct to always do getBytes("ISO-8859-1") in this case. The fix has been committed.

People

Vote (0)
Watch (1)

Dates

  • Created:
    Updated:
    Resolved: