Fixes CS-4637; Fixes encoding in upgrade scripts