File: encoding_change

package info (click to toggle)
phpreports 0.4.9-2
  • links: PTS
  • area: main
  • in suites: lenny, squeeze
  • size: 684 kB
  • ctags: 1,426
  • sloc: php: 3,377; xml: 203; makefile: 29; sql: 18; sh: 17; python: 10
file content (22 lines) | stat: -rwxr-xr-x 414 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/bin/sh
# Use this script to change the default encoding
# from ISO-8859-1 to other that you want.
# Run it on the PHPReports root directory
if [ ! -n "$1" ]
then
	echo Please inform the encoding to use!
	exit 1
fi

temp=/tmp/$$.phprpt
default='ISO-8859-1'
for file in `fgrep -Ril $default *`
do
	echo converting $file ...
	sed s/$default/$1/ $file > $temp
	cp $temp $file
done
if [ -f $temp ]
then
	rm $temp
fi