Skip to content

Instantly share code, notes, and snippets.

@sanssucre
sanssucre / re-encode.sh
Created April 5, 2012 12:49
Bash script to change the encoding of source files.
#!/bin/bash
# I wrote this script to change the encoding of a large
# source code repository with inconsistent file encoding
SOURCE_DIR=$1
FILE_MASK="*.$2"
DESTINATION_ROOT=$3
if [ $# -ne 3 ]; then
class SomeMigrator
def migrator
lambda do |some_object|
{:previous_object => some_object}
end
end
end
migrators = [SomeMigrator.new.migrator, SomeMigrator.new.migrator]
original_object = "original object"