Home > Back-end >  [in] the Java file specifies the GBK, can still generate a utf-8 format file
[in] the Java file specifies the GBK, can still generate a utf-8 format file

Time:05-20

 OutputStreamWriter oStreamWriter=new OutputStreamWriter (new FileOutputStream (filePath), "GBK"); 
OStreamWriter. Append (payFileContent);
OStreamWriter. Close ();


Generated code as above, in the local Windows 7 normal ANSI format file, the server is generated in the Windows server 2012 R2 utf-8 documents,
Code for the data. GetBytes (" GBK ") this also tried to generate, is also not line,

Initial guess is Windows system where there is a set, but according to the baidu checked (CHCP command) didn't also found the problem, a mystery!
Big hand son for advice on a wave of
  • Related