修复了mybait-plus在修改与添加时报错:字符集错误,原因,在使用以上方法时会调用类型转换接口但并不会使用默认字符集,而是给null
parent
47e3b92bbd
commit
f38c958804
|
@ -1,5 +1,6 @@
|
||||||
package com.muyu.common.core.text;
|
package com.muyu.common.core.text;
|
||||||
|
|
||||||
|
import com.muyu.common.core.constant.Constants;
|
||||||
import com.muyu.common.core.utils.StringUtils;
|
import com.muyu.common.core.utils.StringUtils;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
||||||
|
@ -689,11 +690,9 @@ public class Convert {
|
||||||
* @return 字符串
|
* @return 字符串
|
||||||
*/
|
*/
|
||||||
public static String str (Object obj, String charsetName) {
|
public static String str (Object obj, String charsetName) {
|
||||||
System.out.println(obj);
|
|
||||||
try{
|
try{
|
||||||
return str(obj, Charset.forName(charsetName));
|
return str(obj, Charset.forName(charsetName.isEmpty()? Constants.UTF8 : charsetName));
|
||||||
}catch (Exception exception){
|
}catch (Exception exception){
|
||||||
System.out.println("字符转换异常: [{"+obj+"}-{"+charsetName+"}] -> {"+exception.getMessage()+"}");
|
|
||||||
log.error("字符转换异常: [{}-{}] -> {}",obj,charsetName,exception.getMessage(),exception);
|
log.error("字符转换异常: [{}-{}] -> {}",obj,charsetName,exception.getMessage(),exception);
|
||||||
throw new RuntimeException(exception);
|
throw new RuntimeException(exception);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue