[#118346] [Ruby master Bug#20586] Some filesystem calls in dir.c are missing error handling and can return incorrect results if interrupted — "ivoanjo (Ivo Anjo) via ruby-core" <ruby-core@...>
Issue #20586 has been reported by ivoanjo (Ivo Anjo).
13 messages
2024/06/19
[ruby-core:118259] [Ruby master Feature#20567] Net::HTTPResponse#detect_encoding should default to UTF-8 for application/javascript
From:
"postmodern (Hal Brodigan) via ruby-core" <ruby-core@...>
Date:
2024-06-09 01:26:40 UTC
List:
ruby-core #118259
Issue #20567 has been reported by postmodern (Hal Brodigan). ---------------------------------------- Feature #20567: Net::HTTPResponse#detect_encoding should default to UTF-8 for application/javascript https://bugs.ruby-lang.org/issues/20567 * Author: postmodern (Hal Brodigan) * Status: Open ---------------------------------------- It is fairly common now for JavaScript to include UTF-8 characters. If a misconfigured web server returns an `application/javascript` response for a JavaScript file, but *without* `charset=utf-8` in the `Content-Type`, `Net::HTTPResponse` will return a response body with encoding of ASCII-8BIT. This can cause lots of subtle String parsing/encoding issues when the response body is parsed or transformed. `Net::HTTPResponse#detect_encoding` should default the response encoding to UTF-8 if the `Content-Type` includes `application/javascript`. [RFC 4329](https://www.rfc-editor.org/rfc/rfc4329#section-4) also seems to encourage defaulting to UTF-8. -- https://bugs.ruby-lang.org/