# local file ^M Help



## pengtai (Apr 24, 2013)

FreeBSD local wget to download the file encoding ^M appears the same program Linux wget normal regardless of my local or remote upload files all ^M signed binary uploads also like. Will FreeBSD require local set?
Sorry my bad English, I use Google Translate.

```
<?php^M
^M
/**^M
 *
```


```
PHP script, ASCII text, with CRLF line terminators
```


----------



## SirDice (Apr 24, 2013)

The text files have been written on a Windows machine, it has nothing to do with wget. Windows uses a Carriage Return (\r; shows up as a ^M) and a Linefeed (\n) whereas unix typically only uses a Linefeed. It might be possible that wget(1) can translate it automatically, I don't know, I don't use wget. I suggest you have a look in the wget(1) man page.


----------



## ShelLuser (Apr 24, 2013)

pengtai said:
			
		

> PHP script, ASCII text, with CRLF line terminators


And in addition to SirDice's comment above; if this really bothers you then you could consider using the dos2unix conversion program. As can be expected you can install it using the Ports collection, just grab converters/unix2dos.


----------



## drhowarddrfine (Apr 24, 2013)

If you Google "script to remove ctrl m" you can find an easy 2-line or so script to remove those.


----------



## Uniballer (Apr 24, 2013)

If it is a text file you can probably just filter it through the strings program.


----------



## jrm@ (Apr 24, 2013)

Yet another option... If you already have editors/emacs installed, you can run `M-x set-buffer-file-coding-system` and choose undecided-unix.  This will get rid of the carriage returns.


----------

