mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-05-09 23:51:34 +08:00
fix code
This commit is contained in:
parent
faa1ee138b
commit
d56488f2c2
@ -892,7 +892,7 @@ public class ConvertUtil {
|
||||
* @param str 待转换的ASCII字符串
|
||||
* @param charset 编码
|
||||
* @return 16进制字符串
|
||||
* @see HexUtil#encodeStr(String, Charset)
|
||||
* @see HexUtil#encodeStr(CharSequence, Charset)
|
||||
*/
|
||||
public static String toHex(final String str, final Charset charset) {
|
||||
return HexUtil.encodeStr(str, charset);
|
||||
@ -926,10 +926,10 @@ public class ConvertUtil {
|
||||
* @param hexStr Byte字符串(Byte之间无分隔符 如:[616C6B])
|
||||
* @param charset 编码 {@link Charset}
|
||||
* @return 对应的字符串
|
||||
* @see HexUtil#decodeStr(String, Charset)
|
||||
* @see HexUtil#decodeStr(CharSequence, Charset)
|
||||
* @since 4.1.11
|
||||
*/
|
||||
public static String hexToStr(final String hexStr, final Charset charset) {
|
||||
public static String hexToStr(final CharSequence hexStr, final Charset charset) {
|
||||
return HexUtil.decodeStr(hexStr, charset);
|
||||
}
|
||||
|
||||
@ -938,9 +938,9 @@ public class ConvertUtil {
|
||||
*
|
||||
* @param strText 全角字符串
|
||||
* @return String 每个unicode之间无分隔符
|
||||
* @see UnicodeUtil#toUnicode(String)
|
||||
* @see UnicodeUtil#toUnicode(CharSequence)
|
||||
*/
|
||||
public static String strToUnicode(final String strText) {
|
||||
public static String strToUnicode(final CharSequence strText) {
|
||||
return UnicodeUtil.toUnicode(strText);
|
||||
}
|
||||
|
||||
|
@ -98,7 +98,7 @@ public class UnicodeUtil {
|
||||
* @param str 被编码的字符串
|
||||
* @return Unicode字符串
|
||||
*/
|
||||
public static String toUnicode(final String str) {
|
||||
public static String toUnicode(final CharSequence str) {
|
||||
return toUnicode(str, true);
|
||||
}
|
||||
|
||||
@ -109,9 +109,9 @@ public class UnicodeUtil {
|
||||
* @param isSkipAscii 是否跳过ASCII字符(只跳过可见字符)
|
||||
* @return Unicode字符串
|
||||
*/
|
||||
public static String toUnicode(final String str, final boolean isSkipAscii) {
|
||||
public static String toUnicode(final CharSequence str, final boolean isSkipAscii) {
|
||||
if (StrUtil.isEmpty(str)) {
|
||||
return str;
|
||||
return StrUtil.toStringOrNull(str);
|
||||
}
|
||||
|
||||
final int len = str.length();
|
||||
|
Loading…
x
Reference in New Issue
Block a user