in reply to how to determine the text file encoding

To follow up on the Anonymous Monk's reply (which is basically correct), you need to come up with the correct way to have a GB-encoded string assigned to a scalar variable, so that you can pass this to the "gb_to_simp()" function.

For that matter, since you have your string in utf8 already, you don't need to use "gb-to_simp()" (or Encode) at all.

And the point about the BOM, as explained in the first reply, is that perl won't print one automatically -- if you want it in the output, include it in the print statement.

  • Comment on Re: how to determine the text file encoding