Actions
Bug #19570
closed`Exception#full_message` raises an `EncodingError` if the exception contains UTF8 characters after a newline and `Exception#cause` contains UTF8 characters
Description
e = begin
begin
raise "Übersicht"
rescue => e
raise "\n#{e.message}"
end
rescue => e
e
end
e.full_message
will reproduce the error with the exception incompatible character encodings: ASCII-8BIT and UTF-8 (Encoding::CompatibilityError)
.
In this case, all of e.message
, e.cause.message
and e.cause.detailed_message
have a UTF-8 encoding, but e.detailed_message
has an ASCII-8BIT encoding. I think the issue is related to this line (possibly caused by the encoding differences between write_warn2
used here and here in the newline case vs write_warn_str
used here in the no-newline case.
Updated by byroot (Jean Boussier) over 1 year ago
- Backport changed from 2.7: UNKNOWN, 3.0: UNKNOWN, 3.1: UNKNOWN, 3.2: UNKNOWN to 2.7: DONTNEED, 3.0: DONTNEED, 3.1: DONTNEED, 3.2: UNKNOWN
Updated by nobu (Nobuyoshi Nakada) over 1 year ago
Updated by nobu (Nobuyoshi Nakada) over 1 year ago
- Status changed from Open to Closed
Applied in changeset git|c30cab8ce4d2ab21ef75e2a3218cb76b21d78407.
[Bug #19570] Propagate message encoding to decorated message
Actions
Like0
Like0Like0Like0