Javaで文字コードを推測する - Qiita

https://aaaanwz.github.io/post/2019/juniversalchardet/