public class PunyCode extends Object
Constructor and Description |
---|
PunyCode() |
Modifier and Type | Method and Description |
---|---|
static String |
decode(String input)
解码 PunyCode为字符串
|
static String |
decodeDomain(String domain)
解码 PunyCode为域名
|
static String |
encode(CharSequence input)
将内容编码为PunyCode
|
static String |
encode(CharSequence input,
boolean withPrefix)
将内容编码为PunyCode
|
static String |
encodeDomain(String domain)
将域名编码为PunyCode,会忽略"."
|
public static String encodeDomain(String domain) throws HutoolException
domain
- 域名HutoolException
- 计算异常public static String encode(CharSequence input) throws HutoolException
input
- 字符串HutoolException
- 计算异常public static String encode(CharSequence input, boolean withPrefix) throws HutoolException
input
- 字符串withPrefix
- 是否包含 "xn--"前缀HutoolException
- 计算异常public static String decodeDomain(String domain) throws HutoolException
domain
- 域名HutoolException
- 计算异常public static String decode(String input) throws HutoolException
input
- PunyCodeHutoolException
- 计算异常Copyright © 2025. All rights reserved.