Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

Exporting Image files (intermittently) doesn't work:

enter image description here

I get messages back indicating the error is to do with escaping characters:

Syntax::stresc: Unknown string escape \\U.
share|improve this question
add comment

1 Answer

up vote 4 down vote accepted

I am answering my own question to help out other .Net/Mathematica developers in the future.


I am using random file names (DTWERG, ERYFGJ, IYIGGD) and it turns out when Mathematica exports an image file that has a slash and followed by : b, t, n, f, r it recognises/honors the escape slash.

For example when a file name starts with an r as per the screenshots, it treats the \r as a newline, a CRLF!

Using forward slashes rather than backslashes resolved the problem:

enter image description here

share|improve this answer
1  
This applies to Windows-based filenames in standard Mathematica functions like SetDirectory. Hit that one today myself. –  Verbeia Apr 4 '13 at 8:14
    
To be precise, \r is CR. LF is \n. Another way to deal with it is to escape the backslashes. –  Oleksandr R. Jul 14 '13 at 13:11
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.