linux
Remove Mac Encoding
#!/bin/sh
cp $1 $1.
tr 'r' 'n' < $1. > $1
rm $1.
Firstly, to run this linux shell script, you will need shell access. If you are unsure what a shell is, it is high time you figured it out. Linux is great, but without the shell, it's like...uh, not Linux. Contact your web host and ask them for shell access, of course, if you are having problems with Mac encoding, you are probably past this step ;)
Save this file with the name trmac.sh. Then be sure the permissions allow you to execute the file (try
chmod 775
).
For a brief explanation: set the #!/bin/sh to the path to your sh on your linux installation. The other lines use a short series of simple linux commands like copy (cp), translate (tr), and remove (rm) to alter the encoding of the file by way of a temporary file, which is dutifully removed (
rm $i.
).
The way to call this shell script is like this
trmac.sh myMacEncodedFile.php
Last Updated: 2009-02-07 08:23:27