From: "kddnewton (Kevin Newton) via ruby-core" Date: 2026-11-25T15:17:46+00:00 Subject: [ruby-core:127721] [Ruby Bug#22632] parse.y magic encoding comments accept NUL bytes Issue #22632 has been updated by kddnewton (Kevin Newton). My concern is just about the value of the magic comment. Basically if `# encoding: binary\0ignored` should result in `Encoding.find("binary")` or `Encoding.find("binary\0ignored")` with the second one being an ArgumentError. To me it seems like we should make it an ArgumentError because it can't find the encoding. ---------------------------------------- Bug #22632: parse.y magic encoding comments accept NUL bytes https://bugs.ruby-lang.org/issues/22632#change-120259 * Author: kddnewton (Kevin Newton) * Status: Open * Backport: 3.3: UNKNOWN, 3.4: UNKNOWN, 4.0: UNKNOWN ---------------------------------------- I can't tell if this is intentional or not. It doesn't really seem like an issue either way, but I think it should reject NUL bytes as it's a bit odd. ```ruby # encoding: binary\0ignored ``` -- 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/