-
Notifications
You must be signed in to change notification settings - Fork 29
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ArrayIndexOutOfBoundsExceptions when transcoding UTF8-SoftBank=>SJIS-KDDI or CP51932=>CP50220 #42
Comments
Good find! Could be a bug in the transcoder (these were loose ports from the C code in Ruby) or a bad/old unicode table. @lopex got a change to look at this? Maybe it's another one-character fix. 😀 |
I took a look into the CP50220 issue and read through the relevant functions (org.jcodings.transcode.TranscodeFunctions#funSoCp50220Encoder, org.jcodings.transcode.TranscodeFunctions#funSoCp5022xEncoder) and the data table used here (org.jcodings.transcode.TranscodeFunctions#tbl0208) and everything appears to match the C implementation. Reduced case can use "\x00\x7f\x8e\xa1\x8e\xfe\xa1\xa1\xa1\xfe".force_encoding("CP51932").encode("CP50220") It blows up in JRuby and works in CRuby. |
This test, based on #42, was mistakenly added while transitioning to GitHub Actions. I will do a separate PR to restore it and fix the broken logic it tests.
The following unit tests crash in
org.jcodings.transcode.Transcoding
:The text was updated successfully, but these errors were encountered: