Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Minor
-
Resolution: Fixed
-
Affects Version/s: JRuby 0.9.8
-
Fix Version/s: JRuby 1.1RC2
-
Component/s: Core Classes/Modules
-
Labels:None
-
Environment:OS X, 10.4.9 Intel core 2 duo (macbook pro)
-
Number of attachments :
Description
Trying to convert from 'ascii/ignore//translit' to some other character set, Iconv under JRuby doesn't seem to recognize the translit (allow transliteration) and ignore (ignore conversion errors) options (appended to the character type string as demonstrated). Raises java.nio.charset.IllegalCharsetNameException. See stack trace:
java.nio.charset.IllegalCharsetNameException: ascii//ignore//translit
Charset.java:285:in `java.nio.charset.Charset.checkName'
Charset.java:459:in `java.nio.charset.Charset.lookup2'
Charset.java:438:in `java.nio.charset.Charset.lookup'
Charset.java:497:in `java.nio.charset.Charset.forName'
Charset.java:285:in `java.nio.charset.Charset.checkName'
Charset.java:459:in `java.nio.charset.Charset.lookup2'
Charset.java:438:in `java.nio.charset.Charset.lookup'
Charset.java:497:in `java.nio.charset.Charset.forName'
Charset.java:285:in `java.nio.charset.Charset.checkName'
Charset.java:459:in `java.nio.charset.Charset.lookup2'
Charset.java:438:in `java.nio.charset.Charset.lookup'
Charset.java:497:in `java.nio.charset.Charset.forName'
Charset.java:285:in `java.nio.charset.Charset.checkName'
Charset.java:459:in `java.nio.charset.Charset.lookup2'
Charset.java:438:in `java.nio.charset.Charset.lookup'
Charset.java:497:in `java.nio.charset.Charset.forName'
Charset.java:285:in `java.nio.charset.Charset.checkName'
Charset.java:459:in `java.nio.charset.Charset.lookup2'
Charset.java:438:in `java.nio.charset.Charset.lookup'
Charset.java:497:in `java.nio.charset.Charset.forName'
app/models/question.rb:4:in `call'
app/controllers/questions_controller.rb:58:in `transaction'
app/controllers/questions_controller.rb:58:in `create'
app/controllers/questions_controller.rb:60:in `create'
Same iconv method call works fine under normal Ruby 1.8.5 VM.
The problem here is that we aren't even handling this formatted input string for encodings. This is how iconv specifies appropriate settings for the conversion, much like Java's charset stuff does. We just need to find all the options, handle the parsing, and set up charset appropriately.
Finish for 1.0...shouldn't be a huge deal now that we know about it, but any information on the various iconv settings would speed the process along.