From: "nobu (Nobuyoshi Nakada) via ruby-core" Date: 2026-11-25T07:56:39+00:00 Subject: [ruby-core:127709] [Ruby Bug#22632] parse.y magic encoding comments accept NUL bytes Issue #22632 has been updated by nobu (Nobuyoshi Nakada). Now I think a SyntaxError would be better for such a line, while both of parse.y and prism accept it. ```console $ for x in parse.y prism; do echo $'# encoding: binary\0ignored' | ./ruby -vc --parser=$x -; done ruby 4.1.0dev (2026-11-25T06:56:36Z master f63048e942) [arm64-darwin27] Syntax OK ruby 4.1.0dev (2026-11-25T06:56:36Z master f63048e942) +PRISM [arm64-darwin27] Syntax OK ``` Shouldn't we make it so that the both raise a SyntaxError together? ---------------------------------------- Bug #22632: parse.y magic encoding comments accept NUL bytes https://bugs.ruby-lang.org/issues/22632#change-120230 * 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/