1
0
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:
zkzlx 2021-01-22 09:28:53 +08:00
parent bb7afd9033
commit a81430a965
3 changed files with 9 additions and 5 deletions

View File

@ -26,6 +26,7 @@ import java.util.Objects;
import java.util.stream.Collectors;
import com.alibaba.cloud.nacos.utils.NacosConfigUtils;
import org.springframework.boot.env.OriginTrackedMapPropertySource;
import org.springframework.boot.env.PropertiesPropertySourceLoader;
import org.springframework.boot.env.PropertySourceLoader;

View File

@ -79,7 +79,7 @@ public class NacosXmlPropertySourceLoader extends AbstractPropertySourceLoader
* return a list containing a single source, or in the case of a multi-document format
* such as yaml a source for each document in the resource.
* @param name the root name of the property source. If multiple documents are loaded
* an additional suffix should be added to the name for each source loaded.
* an additional suffix should be added to the name for each source loaded.
* @param resource the resource to load
* @return a list property sources
* @throws IOException if the source cannot be loaded

View File

@ -21,10 +21,13 @@ package com.alibaba.cloud.nacos.utils;
*/
public final class NacosConfigUtils {
private NacosConfigUtils(){
}
/**
* Convert Chinese characters to Unicode.
* @param configValue
* @return
* @param configValue value of config
* @return new string
*/
public static String selectiveConvertUnicode(String configValue) {
StringBuilder sb = new StringBuilder();
@ -42,8 +45,8 @@ public final class NacosConfigUtils {
/**
* char is chinese?
* @param c
* @return
* @param c a character
* @return true or false
*/
public static boolean isChinese(char c) {
Character.UnicodeBlock ub = Character.UnicodeBlock.of(c);