public class PunyCode extends Object
参考:https://blog.csdn.net/a19881029/article/details/18262671
Modifier and Type | Field and Description |
---|---|
static String |
PUNY_CODE_PREFIX |
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 final String PUNY_CODE_PREFIX
public static String encodeDomain(String domain) throws UtilException
domain
- 域名UtilException
- 计算异常public static String encode(CharSequence input) throws UtilException
input
- 字符串UtilException
- 计算异常public static String encode(CharSequence input, boolean withPrefix) throws UtilException
input
- 字符串withPrefix
- 是否包含 "xn--"前缀UtilException
- 计算异常public static String decodeDomain(String domain) throws UtilException
domain
- PunyCode域名UtilException
- 计算异常public static String decode(String input) throws UtilException
input
- PunyCodeUtilException
- 计算异常Copyright © 2024. All rights reserved.