Project

General

Profile

Actions

Bug #1098

closed

Unclear encoding error: #<Encoding::UndefinedConversionError: "\xE2\x96\x80" from UTF-8 to ISO-8859-1 in conversion from CP850 to ISO-8859-1>

Added by tomel (Tom Link) over 15 years ago. Updated about 13 years ago.

Status:
Rejected
Target version:
-
ruby -v:
ruby 1.9.1p0 (2009-01-30 revision 21907) [i386-cygwin]
Backport:
[ruby-core:21802]

Description

=begin
The test script below exits with the error: #<Encoding::UndefinedConversionError: "\xE2\x96\x80" from UTF-8 to ISO-8859-1 in conversion from CP850 to ISO-8859-1>

This is weird/unclear/incomprehensible because I fail to see what makes ruby think I'm working with utf8. If this isn't a bug, I would kindly ask to make the error message slightly more intelligible by adding information about what is set to UTF-8, what to ISO-8859-1 etc. The way it is now this message is slighlty esoteric.

Test script:

Encoding: CP850

p Encoding.default_internal, Encoding.default_external # => nil, CP850
s = "weiß"
p s, s.encoding
p s.encode('ISO-8859-1')
=end

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0