From: "zenspider (Ryan Davis) via ruby-core" Date: 2026-10-15T19:00:50+00:00 Subject: [ruby-core:127129] [Ruby Feature#22244] `ruby -UU` should set both internal and external, `ruby -E` should print encoding list Issue #22244 has been updated by zenspider (Ryan Davis). @matz any chance I can get this enhancement into 4.1? I think it helps usability a fair amount: ``` 10001 $ ./build/miniruby tool/runruby.rb --extout=build --archdir=build -- -E Available Encodings: ASCII-8BIT, Big5, Big5-HKSCS, Big5-UAO, CESU-8, CP850, CP852, CP855, CP949, CP950, CP951, CP50220, CP50221, CP51932, Emacs-Mule, EUC-JIS-2004, EUC-JP, EUC-KR, EUC-TW, eucJP-ms, GB1988, GB2312, GB12345, GB18030, GBK, IBM037, IBM437, IBM720, IBM737, IBM775, IBM852, IBM855, IBM857, IBM860, IBM861, IBM862, IBM863, IBM864, IBM865, IBM866, IBM869, ISO-2022-JP, ISO-2022-JP-2, ISO-8859-1, ISO-8859-2, ISO-8859-3, ISO-8859-4, ISO-8859-5, ISO-8859-6, ISO-8859-7, ISO-8859-8, ISO-8859-9, ISO-8859-10, ISO-8859-11, ISO-8859-13, ISO-8859-14, ISO-8859-15, ISO-8859-16, KOI8-R, KOI8-U, macCentEuro, macCroatian, macCyrillic, macGreek, macIceland, MacJapanese, macRoman, macRomania, macThai, macTurkish, macUkraine, Shift_JIS, TIS-620, US-ASCII, UTF8-MAC, UTF-7, UTF-8, UTF-16, UTF-16BE, UTF-16LE, UTF-32, UTF-32BE, UTF-32LE, Windows-31J, Windows-874, Windows-1250, Windows-1251, Windows-1252, Windows-1253, Windows-1254, Windows-1255, Windows-1256, Windows-1257, Windows-1258 ``` ---------------------------------------- Feature #22244: `ruby -UU` should set both internal and external, `ruby -E` should print encoding list https://bugs.ruby-lang.org/issues/22244#change-119533 * Author: zenspider (Ryan Davis) * Status: Open ---------------------------------------- ``` 10004 $ env -u LANG ruby -U -e 'pp [Encoding.default_internal, Encoding.default_external]' [#, #] 10005 $ env -u LANG ruby -EUTF-8 -e 'pp [...]' [nil, #] 10006 $ env -u LANG ruby -EUTF-8 -U -e 'pp [...]' [#, #] 10007 $ env -u LANG ruby -EUTF-8:UTF-8 -e 'pp [...]' [#, #] 10008 $ env -u LANG ruby -UU -e 'pp [...]' [#, #] ``` I think the option processing of encodings is VERY poorly documented and frustrating to try to use. 1. --help doesn't list -U. (The man page does) 2. --help for -E doesn't provide a means to get a list of available encoding names (same with manpage), leading me to try U, UTF8, UTF_8, before finding UTF-8. `ruby -E` could just print them all out. 3. WHY NOT take UTF8 or UTF_8 (since that's the class name)? 4. Please consider `-UU` to mean `-EUTF-8:UTF-8` -- https://bugs.ruby-lang.org/ ______________________________________________ ruby-core mailing list -- ruby-core@ml.ruby-lang.org To unsubscribe send an email to ruby-core-leave@ml.ruby-lang.org ruby-core info -- https://ml.ruby-lang.org/mailman3/lists/ruby-core.ml.ruby-lang.org/