MultipartFile文件編碼判斷學習
搜索:Java 判斷文件的字符集編碼編碼
https://blog.csdn.net/top_code/article/details/8891796spa
可是在MultipartFile狀況下,數值有些不一樣.net
有中文的ASCII 54960 GBK解碼code
UTF-8 59521 UTF-8解碼blog
Unicode 65534 UNICODE解碼ip
UTFbom+ 61371 UTF-8解碼it
UTF-16BE 65279 UNICODE解碼io
數字ASCII 24930 GBK/UTF-8解碼class
txt文件是沒有文件頭的;
學習了:https://rainsilence.iteye.com/blog/842338 能夠使用editplus等進行查看文件的文件頭;
學習了:https://blog.csdn.net/qq_29347295/article/details/78361796
https://my.oschina.net/nivalsoul/blog/791243
使用Cpdetector檢測編碼;
charset = detector.detectCodepage(is, 888); // 多輸入幾個字符進行判斷;