Fixed the generator to deal with unicode at all. Previously it was implicitly dealing with utf-8 files as ASCII.