Skip to content

Instantly share code, notes, and snippets.

@vandersonmota
Created May 5, 2012 21:32
Show Gist options
  • Save vandersonmota/2605711 to your computer and use it in GitHub Desktop.
Save vandersonmota/2605711 to your computer and use it in GitHub Desktop.
use this to put encoding utf-8 in you ruby files
#! /bin/bash
for f in `find . -name *.rb`
do
sed -n '1p;' $f | grep -E '^#(coding| coding|-\*-| -\*-)' > /dev/null
if [ $? != 0 ]
then
sed -i '1i #coding: utf-8' $f
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment