Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

edit: it was a syntax error - the IP is not supposed to be in this line. so nothing to do with encoding.

Startup error: Error in "": invalid character (' ', 0x20) in domain

Im getting this error when trying to start a program (PowerMTA). I've edited the config file under windows and I guess its some encoding error? I tried using dos2unix but still getting the same error. This 0x20 is the code for space. (The space in the string in the error message is supposed to be there) I edited the file under linux too but still the same. Any ideas? tyia

share|improve this question
unusual approach for small config files: show the file with cat, copy the text from terminal into new file (directly under linux), try again. – Dennis Nolte Jul 17 '14 at 20:46
dos2unix is your friend. – Iain Jul 17 '14 at 20:51
@DennisNolte the file is too large to get in one terminal window with cat. I tried doing what you suggested only to the problematic line with grep but still no result. @ Iain I tried using it : dos2unix -n file1 file2 still getting the same error – nailoxx Jul 17 '14 at 21:13
I've resolved some odd encoding/transcoding/characterset issues with the -b switch in vi/vim e.g. env LANG=C vi -b <filename>. In general Windows tends to do some interesting things with following typesetting conventions (even in a primitive text editor like WordPad) which are correct for print but not so much for editing configuration files... – HBruijn Jul 17 '14 at 22:37
Are you sure you don't have a syntax error in a previous line? – Michael Hampton Jul 17 '14 at 23:06

it's likely a problem with how windows handles newlines vs. linux's method. Linux uses \n whereas Windows uses \r\n. You'd have to delete the character at the end of the line to remove it. Or you can use something like vim to search and replace it.

check this out for help

share|improve this answer
how would I search and replace it with nano w/o replacing all the others spaces ? – nailoxx Jul 17 '14 at 21:27
@user233347 i edited my response. check the link provided. that should help. although, it doesn't offer a nano solution. – majikman Jul 17 '14 at 22:51
I tried with vi and I get: E486: Pattern not found: ^M I also tried with tr like shown in the link but still nothing . The strange thing is I removed the line in question and typed it manually in nano but still getting the error on that line. Is it possible the problem is somewhere else ? – nailoxx Jul 18 '14 at 11:42

0x20 is a space, so it sounds like you have extra space somewhere.

share|improve this answer
obviously. but what he's asking is how to get rid of it. – Michael Martinez Jul 17 '14 at 22:32

Your Answer


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.