Robotics StackExchange | Archived questions

Encoding issue: Coding on Windows 7 and transferring to Linux and my scripts are not working. What is causing this issue?

I've been coding some of my launch files, scripts, etc in Windows 7 and I've noticed that there is some encoding issue that I can only resolve by recopying the code (I made in Windows) into new files that I create on my Linux hardware.

I verified that my scripts and launch files work by testing them on my Linux hardware after remaking them.

I have been using Notepad++ and Eclipse on Windows 7 fyi. And I'm using ROS Indigo.

Edit with ERRORS:

Asked by RAS_Trent on 2016-11-17 11:15:14 UTC

Comments

Some text editors will use fancy (unicode) quotes that aren't expected by roslaunch; and windows and Linux use slightly different newline characters. The dos2unix program can convert line endings, but I'm not aware of anything that converts quotes.

Asked by ahendrix on 2016-11-17 11:31:57 UTC

It would also be helpful if you could post the actual error message that you get, so that we don't have to guess at your issue.

Asked by ahendrix on 2016-11-17 11:32:56 UTC

I would also check newlines. Linux uses Unix-style (\n), while Windows uses .. Windows-style (\r\n). The python interpreter doesn't like it very much if you mix them, and weird things can happen. On Ubuntu, the fromdos and todos utilities can help you convert them.

Asked by gvdhoorn on 2016-11-17 12:25:10 UTC

ahendrix, I posted the kinds of errors I would see.

I had similar issues with rosrun and some other commands that seemed to be fixed by using new files.

Asked by RAS_Trent on 2016-11-17 14:53:05 UTC

Answers