java中文乱码的处理类

xiaoxiao2021-02-28  31

public class EncodingChange {     public static String toString(String str) {     try {     if (str == null || str.trim().equals("")) {     return "";     } else {     return new String(str.getBytes("ISO-8859-1"), "UTF-8");     }     } catch (UnsupportedEncodingException e) {     e.printStackTrace();     return str;    }  } }
转载请注明原文地址: https://www.6miu.com/read-2050219.html

最新回复(0)