The Chinese file name is converted to a UTF8 encoding method.

xiaoxiao2021-03-05  19

/ ** * turn the Chinese characters in the file name into the UTF8 encoded string so that you can correctly display the saved file name. * @Param s Original file name * @return Recode file name * / public static string toutf8string String s) {stringbuffer sb = new stringbuffer (); for (int i = 0; i = 0 && c <= 255) {sb.append (c);} else {byte [] b; try {b = character.tostring (c) .getbytes ("UTF-8");} catch (exception ex) {system.out.println (EX); b = new byte [0];} for (int J = 0; j

转载请注明原文地址:https://www.9cbs.com/read-38581.html

New Post(0)