NetLogo/NetLogo-Headless — pull request #19 by mrerrormessage (2014-11-18 16:19:18+00:00)
Title: TextBoxReader should parse escape characters into real characters

Currently, this text:

![](https://cloud.githubusercontent.com/assets/28215/5081005/48463266-6e8e-11e4-8a89-0e3bcdf1261c.png)

is represented like this in the nlogo file:

`"	I'm tabbed\nI'm newlined\\hi\\n"`

(copy and pasted from the file with quotes added; the first space is a tab)

As you can see, newlines and backslashes are escaped in the file. However, post parsing, the `TextBox` object contains (fully escaped):

`"\tI'm tabbed\\nI'm newlined\\\\hi\\\\n"`

Notice the "\\n" in the middle and the "\\\\". Unescaped, these would be "\n" and "\\". That is, the internal representation has unnecessarily and inappropriately preserved the escaping from the file. The string should just be (fully escaped):

`"\tI'm tabbed\nI'm newlined\\hi\\n"`

That is, the newline should actually be a newline, the backslashes should just be backslashes, and so forth.

Original discussed in NetLogo/Galapagos#167