From: duerst@... Date: 2019-06-26T09:13:08+00:00 Subject: [ruby-dev:50803] [Ruby trunk Feature#15931] encoding for CESU-8 Issue #15931 has been updated by duerst (Martin Dürst). 念のために言っておきますが、https://www.unicode.org/reports/tr26/tr26-4.html に「It is not intended nor recommended as an encoding used for open information exchange.」と書いてあります。くれぐれもよくご注意ください。 さらに、https://www.unicode.org/reports/tr26/ に「CESU-8 documents an obsolete internal-use encoding scheme for Unicode identical to UTF-8 except for its representation of supplementary characters.」と「CESU-8 is not intended nor recommended as an encoding used for open information exchange. Therefore, there is no need to develop this report any further.」と書いてあります。 これはあくまでも完全に Java 側の問題で、なぜ Ruby 側で対応しないといけないのか全く分かりません。できれば Revision 7f64a0b4 を逆戻りしていただきたいです。Ruby が文字コードの混乱に貢献してほしくないからです。 ---------------------------------------- Feature #15931: encoding for CESU-8 https://bugs.ruby-lang.org/issues/15931#change-78888 * Author: arton (Akio Tajima) * Status: Closed * Priority: Normal * Assignee: naruse (Yui NARUSE) * Target version: 2.7 ---------------------------------------- RubyとJavaのブリッジを開発していて、文字列の変換処理で困っています。 現象) JavaのUTF-8は非標準的な形式 (https://docs.oracle.com/javase/8/docs/technotes/guides/jni/spec/types.html#modified_utf_8_strings) なので、Ruby側の文字列をそのままUTF-8にエンコードして与えると、Java側ではサロゲートペアに相当する文字を正しく認識できません。 お願い) Java固有の拡張UTF-8は一般性が欠けていると考えられますが、ほぼ互換のCESU-8 (https://www.unicode.org/reports/tr26/tr26-4.html) は、IANAの文字セットにも登録されていて通信などでそれなりに利用されているようなので、RubyのEncodingでサポートしていただきたいと思います。 よろしくご検討ください。 -- https://bugs.ruby-lang.org/