On Aug 13, 3:03 am, greg <greg.johnse... / gmail.com> wrote:
> How can you encode a ENTER? In case of space: \s, what about ENTER?

On MacOS (before version X), pressing the 'return' key inserted a
carriage return (CR) character, ASCII value 13, represented in a Ruby
string by "\r".

On *nix-variants (including Mac OS X), pressing the (enter/return) key
inserts a line feed (LF) character, ASCII value 10, represented in a
Ruby string by "\n".

On Windows, pressing the 'enter' key key inserts a CR/LF pair,
representable in a Ruby string as "\r\n".

Thankfully, MacOS is no more, and now there are only two flavors to
work with. Unfortunately, more disparities abound than just text
files.

In Firefox (and Safari) on Windows, the line endings for <textarea>
elements in web pages are exposed to JS as LF characters. In IE on
Windows, the line endings are CR/LF pairs. (I don't have any other
browsers/OS readily available to test right now.)

Does that help?