diff options
author | Kevin Newton <kddnewton@gmail.com> | 2023-11-30 09:21:48 -0500 |
---|---|---|
committer | Kevin Newton <kddnewton@gmail.com> | 2023-11-30 21:37:56 -0500 |
commit | ca26e0e34bcf41b5ce60f15dc5db5bae8bb36305 (patch) | |
tree | 5e72681c2e8649c06aa7cf10e875fa898c5c5a2e /test/prism/encoding_test.rb | |
parent | dde0abb29ea119e5ae5ce7a01b9d007ce5403a37 (diff) | |
download | ruby-ca26e0e34bcf41b5ce60f15dc5db5bae8bb36305.tar.gz |
[ruby/prism] EUC-TW encoding
https://github.com/ruby/prism/commit/edfb54f039
Diffstat (limited to 'test/prism/encoding_test.rb')
-rw-r--r-- | test/prism/encoding_test.rb | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/test/prism/encoding_test.rb b/test/prism/encoding_test.rb index b09c5479b6..3135bef824 100644 --- a/test/prism/encoding_test.rb +++ b/test/prism/encoding_test.rb @@ -111,6 +111,12 @@ module Prism *((0x81..0xFE).flat_map { |byte1| (0x30...0x40).flat_map { |byte2| (0x81..0xFE).flat_map { |byte3| (0x2F...0x41).map { |byte4| byte1 << 24 | byte2 << 16 | byte3 << 8 | byte4 } } } }), ] + codepoints_euc_tw = [ + *(0..0x7F), + *(0xA1..0xFF).flat_map { |byte1| (0xA1..0xFF).map { |byte2| (byte1 << 8) | byte2 } }, + *(0xA1..0xB0).flat_map { |byte2| (0xA1..0xFF).flat_map { |byte3| (0xA1..0xFF).flat_map { |byte4| 0x8E << 24 | byte2 << 16 | byte3 << 8 | byte4 } } } + ] + encodings.merge!( Encoding::UTF_8 => codepoints_unicode, Encoding::UTF8_MAC => codepoints_unicode, @@ -124,7 +130,8 @@ module Prism Encoding::EMACS_MULE => codepoints_emacs_mule, Encoding::STATELESS_ISO_2022_JP => codepoints_emacs_mule, Encoding::STATELESS_ISO_2022_JP_KDDI => codepoints_emacs_mule, - Encoding::GB18030 => codepoints_gb18030 + Encoding::GB18030 => codepoints_gb18030, + Encoding::EUC_TW => codepoints_euc_tw, ) end |