mirror of
https://gitee.com/mirrors/Spring-Cloud-Alibaba.git
synced 2021-06-26 13:25:11 +08:00
fixed chinese garbled for nacos-config
This commit is contained in:
parent
bb7afd9033
commit
a81430a965
@ -26,6 +26,7 @@ import java.util.Objects;
|
|||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
import com.alibaba.cloud.nacos.utils.NacosConfigUtils;
|
import com.alibaba.cloud.nacos.utils.NacosConfigUtils;
|
||||||
|
|
||||||
import org.springframework.boot.env.OriginTrackedMapPropertySource;
|
import org.springframework.boot.env.OriginTrackedMapPropertySource;
|
||||||
import org.springframework.boot.env.PropertiesPropertySourceLoader;
|
import org.springframework.boot.env.PropertiesPropertySourceLoader;
|
||||||
import org.springframework.boot.env.PropertySourceLoader;
|
import org.springframework.boot.env.PropertySourceLoader;
|
||||||
|
@ -21,10 +21,13 @@ package com.alibaba.cloud.nacos.utils;
|
|||||||
*/
|
*/
|
||||||
public final class NacosConfigUtils {
|
public final class NacosConfigUtils {
|
||||||
|
|
||||||
|
private NacosConfigUtils(){
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Convert Chinese characters to Unicode.
|
* Convert Chinese characters to Unicode.
|
||||||
* @param configValue
|
* @param configValue value of config
|
||||||
* @return
|
* @return new string
|
||||||
*/
|
*/
|
||||||
public static String selectiveConvertUnicode(String configValue) {
|
public static String selectiveConvertUnicode(String configValue) {
|
||||||
StringBuilder sb = new StringBuilder();
|
StringBuilder sb = new StringBuilder();
|
||||||
@ -42,8 +45,8 @@ public final class NacosConfigUtils {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* char is chinese?
|
* char is chinese?
|
||||||
* @param c
|
* @param c a character
|
||||||
* @return
|
* @return true or false
|
||||||
*/
|
*/
|
||||||
public static boolean isChinese(char c) {
|
public static boolean isChinese(char c) {
|
||||||
Character.UnicodeBlock ub = Character.UnicodeBlock.of(c);
|
Character.UnicodeBlock ub = Character.UnicodeBlock.of(c);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user