Skip to content
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

ASCIIに判定されたものを変換しようとすると例外をはくようになった問題 #1

Closed
Narazaka opened this issue Nov 29, 2014 · 1 comment

Comments

@Narazaka
Copy link

1.0.10から1.0.11への変更にかけて、ASCIIと判定されたコードを変換しようとすると例外をはくようになりました。
これは下記のように非対応のエンコードをスルーしていたものを例外をはくように変更した影響で、対応している文字コードの範囲内ではスルー処理しても問題のないASCIIがはじかれることによって起こります。

1.0.10 line: 184

  if (hasOwnProperty.call(Encoding, func)) {
    return Encoding[func](data);
  }
}
return data;

1.0.11 line: 118

  if (!hasOwnProperty.call(EncodingDetect, method)) {
    throw new Error('Undefined encoding: ' + e);
  } else if (EncodingDetect[method](data)) {
    return encoding;
  }

AUTOでdetectしてASCIIだったらてきとうにSJISだよとしてconvertしたりすれば回避可能ですが、不便なのでできればスルーあるいはメソッド定義など対応お願いします。

polygonplanet added a commit that referenced this issue Nov 29, 2014
@polygonplanet
Copy link
Owner

ASCII に対するテストが抜けていました・・申し訳ないです
1.0.12 にて例外を吐かずにもとのデータを返すよう修正しました
ご報告ありがとうございます!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants