mirror of
https://github.com/ruby/ruby.git
synced 2026-08-01 16:00:28 +08:00
The ascii-compatible path builds a binary buffer but returned numeric character references via chr(enc), so a non-ASCII replacement appended to a buffer that already held non-ASCII bytes raised Encoding::CompatibilityError. Decode into the binary buffer instead, matching the C extension's optimized_unescape_html for out-of-range references (kept verbatim, leading zeros included) and surrogate code points (emitted as raw bytes). https://github.com/ruby/cgi/issues/103 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> https://github.com/ruby/cgi/commit/09970b06d328