Project

General

Profile

Actions

Bug #8123

closed

Transcoding exception when using replace along with universal_newline

Added by k776 (Kieran P) about 11 years ago. Updated over 5 years ago.

Status:
Closed
Assignee:
-
Target version:
-
ruby -v:
1.9.3 and 2.0.0
[ruby-core:53528]

Description

The following can be reproduced on 1.9.3-p385, 1.9.3-p392, and 2.0.0-p0.

body, charset = "hey", "hey".encoding.to_s
body = body.encode('UTF-8', charset,
:invalid => :replace, :undef => :replace,
:replace => '', :universal_newline => true
)
Encoding::ConverterNotFoundError: code converter not found (universal_newline)

However, if you remove ":replace => '', ", then it works as intended.

Seems you can't use the two options together.


Related issues 1 (0 open1 closed)

Related to Ruby master - Bug #12431: Strange behavior of String#encode('UTF-8', 'UTF-8', ...) when the encoding of the source string is not UTF-8ClosedActions
Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0