From: "matz (Yukihiro Matsumoto) via ruby-core" Date: 2026-11-13T08:52:02+00:00 Subject: [ruby-core:127463] [Ruby Feature#22244] `ruby -UU` should set both internal and external, `ruby -E` should print encoding list Issue #22244 has been updated by matz (Yukihiro Matsumoto). For now, I agree with @naruse. The internal encoding is for automatic conversion, and setting `LANG` properly is the recommended way, so I don't see the need for `-UU` to set both. For the other points, `Encoding.name_list` already gives the list of encodings, and I'd like to keep `--help` within one page. That said, I may reconsider `-UU` if you can describe in detail the cases where the change is really useful, for example, environments or circumstances where `LANG` cannot be set. Matz. ---------------------------------------- Feature #22244: `ruby -UU` should set both internal and external, `ruby -E` should print encoding list https://bugs.ruby-lang.org/issues/22244#change-119925 * 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/