Java automatically reads to avoid garble code based on the encoding of the file content

  • 2020-04-01 02:55:52
  • OfStack

The open source jar package cpdetector can automatically determine the content encoding of the current file, so as to select the correct encoding to read when reading, so as to avoid the problem of messy code.

Test results, provide screenshots:

GBK file contents

< img border = 0 SRC = "/ / files.jb51.net/file_images/article/201402/2014220154731974.jpg" >

Related articles: