Changed the function for replacing invalid GBK line characters with underscores