Skip to content

Commit 0bd8847

Browse files
committed
Merge remote-tracking branch 'origin/master' into develop
2 parents 2845f32 + aea812b commit 0bd8847

File tree

4 files changed

+39
-30
lines changed

4 files changed

+39
-30
lines changed

.github/FUNDING.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# These are supported funding model platforms
2+
3+
github: #houko
4+
patreon: hupeng
5+
open_collective: SpringBootUnity
6+
ko_fi: hupeng
7+
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
8+
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
9+
liberapay: # Replace with a single Liberapay username
10+
issuehunt: houko/SpringBootUnity
11+
otechie: # Replace with a single Otechie username
12+
custom: https:blog.xiaomo.info

README.md renamed to Readme.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
[![Build Status](https://travis-ci.org/xiaomoinfo/SpringBootUnity.svg?branch=master)](https://travis-ci.org/xiaomoinfo/SpringBootUnity)
2-
[![Backers on Open Collective](https://opencollective.com/SpringBootUnity/backers/badge.svg)](#backers) [![Sponsors on Open Collective](https://opencollective.com/SpringBootUnity/sponsors/badge.svg)](#sponsors) [![GitHub issues](https://img.shields.io/github/issues/xiaomoinfo/SpringBootUnity.svg)](https://github.com/xiaomoinfo/SpringBootUnity/issues)
3-
[![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg)](https://raw.githubusercontent.com/xiaomoinfo/MysqlBlobToJsonTool/master/LICENSE)
1+
[![Build Status](https://travis-ci.org/houko/SpringBootUnity.svg?branch=master)](https://travis-ci.org/houko/SpringBootUnity)
2+
[![Backers on Open Collective](https://opencollective.com/SpringBootUnity/backers/badge.svg)](#backers) [![Sponsors on Open Collective](https://opencollective.com/SpringBootUnity/sponsors/badge.svg)](#sponsors) [![GitHub issues](https://img.shields.io/github/issues/houko/SpringBootUnity.svg)](https://github.com/houko/SpringBootUnity/issues)
3+
[![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg)](https://raw.githubusercontent.com/houko/SpringBootUnity/master/LICENSE)
44
[![Maven Central](https://img.shields.io/maven-central/v/org.apache.maven/apache-maven.svg)]()
55

66
### 项目简介
@@ -17,7 +17,7 @@
1717

1818

1919
### 注意事项
20-
- 本项目代码托管在[github](https://github.com/xiaomoinfo/SpringBootUnity)[码云](http://git.oschina.net/hupeng/SpringBootUnity)两个地方,最新代码会先推送在github上,码云上会在github上更新完之后进行同步。
20+
- 本项目代码托管在[github](https://github.com/houko/SpringBootUnity)[码云](http://git.oschina.net/hupeng/SpringBootUnity)两个地方,最新代码会先推送在github上,码云上会在github上更新完之后进行同步。
2121
- 本项目多数数据库都用到了`hibernate`,如果没有提供`sql`文件。则启动时会根据代码映射自动生成数据库表,请在启动前修改`application.properties`中的数据库连接信息
2222

2323

core/src/main/java/info/xiaomo/core/untils/CharUtil.java

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package info.xiaomo.core.untils;
22

33
import java.io.UnsupportedEncodingException;
4+
import java.nio.charset.StandardCharsets;
45
import java.util.Objects;
56

67
/**
@@ -17,7 +18,7 @@ public class CharUtil {
1718
public static String iso2gb(String text) {
1819
String result;
1920
try {
20-
result = new String(text.getBytes("ISO-8859-1"), "GB2312");
21+
result = new String(text.getBytes(StandardCharsets.ISO_8859_1), "GB2312");
2122
} catch (UnsupportedEncodingException ex) {
2223
result = ex.toString();
2324
}
@@ -30,7 +31,7 @@ public static String iso2gb(String text) {
3031
public static String gb2iso(String text) {
3132
String result = "";
3233
try {
33-
result = new String(text.getBytes("GB2312"), "ISO-8859-1");
34+
result = new String(text.getBytes("GB2312"), StandardCharsets.ISO_8859_1);
3435
} catch (UnsupportedEncodingException ex) {
3536
ex.printStackTrace();
3637
}
@@ -51,7 +52,7 @@ public static String utf8urlencode(String text) {
5152

5253
byte[] b = new byte[0];
5354
try {
54-
b = Character.toString(c).getBytes("UTF-8");
55+
b = Character.toString(c).getBytes(StandardCharsets.UTF_8);
5556
} catch (Exception ignored) {
5657
}
5758

@@ -72,7 +73,7 @@ public static String utf8urlencode(String text) {
7273
* Utf8URL解码
7374
*/
7475
public static String utf8urldecode(String text) {
75-
String result = "";
76+
StringBuilder result = new StringBuilder();
7677
int p;
7778
if (text != null && text.length() > 0) {
7879
text = text.toLowerCase();
@@ -81,13 +82,13 @@ public static String utf8urldecode(String text) {
8182
return text;
8283
}
8384
while (p != -1) {
84-
result += text.substring(0, p);
85-
text = text.substring(p, text.length());
85+
result.append(text, 0, p);
86+
text = text.substring(p);
8687
if (Objects.equals(text, "") || text.length() < 9) {
87-
return result;
88+
return result.toString();
8889
}
89-
result += codetoword(text.substring(0, 9));
90-
text = text.substring(9, text.length());
90+
result.append(codetoword(text.substring(0, 9)));
91+
text = text.substring(9);
9192
p = text.indexOf("%e");
9293
}
9394
}
@@ -104,11 +105,7 @@ private static String codetoword(String text) {
104105
code[0] = (byte) (Integer.parseInt(text.substring(1, 3), 16) - 256);
105106
code[1] = (byte) (Integer.parseInt(text.substring(4, 6), 16) - 256);
106107
code[2] = (byte) (Integer.parseInt(text.substring(7, 9), 16) - 256);
107-
try {
108-
result = new String(code, "UTF-8");
109-
} catch (UnsupportedEncodingException ex) {
110-
result = null;
111-
}
108+
result = new String(code, StandardCharsets.UTF_8);
112109
} else {
113110
result = text;
114111
}

pom.xml

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -47,17 +47,17 @@
4747
</developer>
4848
</developers>
4949

50-
<repositories>
51-
<repository>
52-
<id>central</id>
53-
<name>aliyun maven</name>
54-
<layout>default</layout>
55-
<url>http://maven.aliyun.com/nexus/content/groups/public/</url>
56-
<snapshots>
57-
<enabled>true</enabled>
58-
</snapshots>
59-
</repository>
60-
</repositories>
50+
<!--<repositories>-->
51+
<!--<repository>-->
52+
<!--<id>central</id>-->
53+
<!--<name>aliyun maven</name>-->
54+
<!--<layout>default</layout>-->
55+
<!--<url>http://maven.aliyun.com/nexus/content/groups/public/</url>-->
56+
<!--<snapshots>-->
57+
<!--<enabled>true</enabled>-->
58+
<!--</snapshots>-->
59+
<!--</repository>-->
60+
<!--</repositories>-->
6161

6262
<!-- 属性 -->
6363
<properties>
@@ -78,7 +78,7 @@
7878
<!-- io util -->
7979
<commons-io.version>2.5</commons-io.version>
8080
<!-- upload util -->
81-
<commons-fileupload.version>1.3.2</commons-fileupload.version>
81+
<commons-fileupload.version>[1.3.3,)</commons-fileupload.version>
8282
<!-- json support -->
8383
<fastjson.version>[1.2.31,)</fastjson.version>
8484
<!-- html -->

0 commit comments

Comments
 (0)