This commit is contained in:
Looly 2024-11-05 19:28:09 +08:00
parent faa1ee138b
commit d56488f2c2
2 changed files with 8 additions and 8 deletions

View File

@ -892,7 +892,7 @@ public class ConvertUtil {
* @param str 待转换的ASCII字符串 * @param str 待转换的ASCII字符串
* @param charset 编码 * @param charset 编码
* @return 16进制字符串 * @return 16进制字符串
* @see HexUtil#encodeStr(String, Charset) * @see HexUtil#encodeStr(CharSequence, Charset)
*/ */
public static String toHex(final String str, final Charset charset) { public static String toHex(final String str, final Charset charset) {
return HexUtil.encodeStr(str, charset); return HexUtil.encodeStr(str, charset);
@ -926,10 +926,10 @@ public class ConvertUtil {
* @param hexStr Byte字符串(Byte之间无分隔符 :[616C6B]) * @param hexStr Byte字符串(Byte之间无分隔符 :[616C6B])
* @param charset 编码 {@link Charset} * @param charset 编码 {@link Charset}
* @return 对应的字符串 * @return 对应的字符串
* @see HexUtil#decodeStr(String, Charset) * @see HexUtil#decodeStr(CharSequence, Charset)
* @since 4.1.11 * @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); return HexUtil.decodeStr(hexStr, charset);
} }
@ -938,9 +938,9 @@ public class ConvertUtil {
* *
* @param strText 全角字符串 * @param strText 全角字符串
* @return String 每个unicode之间无分隔符 * @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); return UnicodeUtil.toUnicode(strText);
} }

View File

@ -98,7 +98,7 @@ public class UnicodeUtil {
* @param str 被编码的字符串 * @param str 被编码的字符串
* @return Unicode字符串 * @return Unicode字符串
*/ */
public static String toUnicode(final String str) { public static String toUnicode(final CharSequence str) {
return toUnicode(str, true); return toUnicode(str, true);
} }
@ -109,9 +109,9 @@ public class UnicodeUtil {
* @param isSkipAscii 是否跳过ASCII字符只跳过可见字符 * @param isSkipAscii 是否跳过ASCII字符只跳过可见字符
* @return Unicode字符串 * @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)) { if (StrUtil.isEmpty(str)) {
return str; return StrUtil.toStringOrNull(str);
} }
final int len = str.length(); final int len = str.length();