Bug #8123

Transcoding exception when using replace along with universal_newline

Added by Kieran P about 1 year ago.

[ruby-core:53528]
Status:Open
Priority:Normal
Assignee:-
Category:-
Target version:-
ruby -v:1.9.3 and 2.0.0 Backport:

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.tos
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.

Also available in: Atom PDF