# The character sequence “\\. d” triggers line break in strings

Bug introduced in 7.0 or earlier and persists through 11.0.0
Bug isn't present in version 5.2

Update: Sjoerd pointed out that this happens with any string and it is not related to StringForm. Just evaluate "foo bar \\. daz.". Or type "\\. d directly, and watch the cursor jump after typing the d.

I found the weirdest problem with messages and StringForm.

This works fine:

But let's change that b to a d now:

What is going on? Where did that line break come from?

It turns out that the problem is actually in StringForm.

StringForm["foo bar \\. daz."]


It's a bug and it's there at least in 8.0.4-10.4.1. But can anyone offer an explanation about the cause? Removing either the backslash (remember that \\ denotes a single backslash) or the . or changing the d to something else prevents the problem. It doesn't matter if I use a capital or lowercase d.

• It's even weirder: In an empty cell type "\. d" (including the double quote character) and the cursor moves to the next line the moment you press the 'd' button. – Sjoerd C. de Vries Jun 19 '16 at 12:42
• Note also that "\\." and "\." yield the same characters. Clearly a bug and perhaps related to the bug Alexey reported earlier this week. – Sjoerd C. de Vries Jun 19 '16 at 12:47
• Note BTW that "\." is used to initiate a hexadecimal character code. "\. d" doing something like the above may be related to the carriage return being ASCII 13 and d the hexadecimal notation for 13. Apparently, space+d are similar to 0d. – Sjoerd C. de Vries Jun 19 '16 at 13:02
• Yep, the bug is, I guess, that the first "\" doesn't escape the second one. – Sjoerd C. de Vries Jun 19 '16 at 13:20
• Also present in version 7. I guess probably introduced in 6. – Oleksandr R. Jun 19 '16 at 14:59

This seems to be related to the notation "\.XX" being used to enter characters in hexadecimal notation, as explained in the documentation.
For instance, entering "\.09" will get you the tab character, which in ASCII has the value 9. Similarly "\.0d" codes for the Carriage Return (CR) character.
1. "\. d" has the space acting as a zero, making it act like a CR and
2. in "\\. d" the first backslash is supposed to escape the second one (according to this documentation, so that the string should consist of the literal characters "\", ".", " " and "d", but it doesn't work out that way.
• This bug is also present in the 4-digit version as well. \:   d (with a colon and three spaces) also behaves the same way. – JungHwan Min Jun 19 '16 at 15:40