From bba2bfc97512014134ea1c172e7a077bddebdbad Mon Sep 17 00:00:00 2001 From: Alan Wu Date: Wed, 21 Dec 2022 12:34:08 -0500 Subject: [DOC] encodings.rdoc: universal_newline reacts to \r It wasn't clear that the mode also translates "\r" to "\n". --- doc/encodings.rdoc | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'doc') diff --git a/doc/encodings.rdoc b/doc/encodings.rdoc index c61ab11e9a..1f3c54d740 100644 --- a/doc/encodings.rdoc +++ b/doc/encodings.rdoc @@ -467,12 +467,13 @@ These keyword-value pairs specify encoding options: with a carriage-return character ("\r"). - :crlf_newline: true: Replace each line-feed character ("\n") with a carriage-return/line-feed string ("\r\n"). - - :universal_newline: true: Replace each carriage-return/line-feed string + - :universal_newline: true: Replace each carriage-return + character ("\r") and each carriage-return/line-feed string ("\r\n") with a line-feed character ("\n"). Examples: - s = "\n \r\n" # => "\n \r\n" - s.encode('ASCII', cr_newline: true) # => "\r \r\r" - s.encode('ASCII', crlf_newline: true) # => "\r\n \r\r\n" - s.encode('ASCII', universal_newline: true) # => "\n \n" + s = "\n \r \r\n" # => "\n \r \r\n" + s.encode('ASCII', cr_newline: true) # => "\r \r \r\r" + s.encode('ASCII', crlf_newline: true) # => "\r\n \r \r\r\n" + s.encode('ASCII', universal_newline: true) # => "\n \n \n" -- cgit v1.2.3