Fixing encoding for generator