utf8 encoding makes functional testing troubled

My gut feeling is that it shouldn't be unfixable. And then the correct course of action would be to fix your tests. There are a lot of Ruby functions that cannot be used safely with Unicode. Change your tests to be Unicode friendly.