cURL
curl "https://api.ruseo.cn/api/emoji2unicode?text=%F0%9F%98%80&format=all"
将Emoji或任意字符转换为Unicode编码,返回码点、UTF-8字节、HTML实体、CSS转义、JS转义、Python转义等格式
https://api.ruseo.cn/api/emoji2unicode
接口调用前需要确认的核心配置。
/api/emoji2unicodeemoji2unicode必填参数必须传入,示例值可直接用于联调。
免费API不强制要求API Key,但如果您希望统计个人调用次数,请在请求时附加参数 key=您的API_KEY。
注册账号后即可获得API Key。
| 参数名 | 必填 | 类型 | 说明 | 示例值 |
|---|---|---|---|---|
key |
否 | string | 可选参数:携带此参数可统计您的个人调用次数。请注册账号获取API Key。 | YOUR_API_KEY |
text |
是 | string | Emoji字符或任意文本 | 😀 |
format |
否 | string | 输出格式:all(全部) / codepoint / utf8 / html / css / js / python | all |
优先使用示例地址测试请求参数是否正确。
https://api.ruseo.cn/api/emoji2unicode?text=%F0%9F%98%80&format=all
curl "https://api.ruseo.cn/api/emoji2unicode?text=%F0%9F%98%80&format=all"
$url = 'https://api.ruseo.cn/api/emoji2unicode?text=%F0%9F%98%80&format=all';
$response = file_get_contents($url);
$data = json_decode($response, true);
fetch('https://api.ruseo.cn/api/emoji2unicode?text=%F0%9F%98%80&format=all')
.then(res => res.json())
.then(data => console.log(data));
实际返回内容以接口脚本处理结果为准。
{
"code": 0,
"msg": "success",
"data": {
"route": "emoji2unicode",
"example": true
}
}
| 参数名 | 类型 | 说明 | 示例值 |
|---|---|---|---|
code |
integer | 状态码,0=成功 | |
data.text |
string | 原始输入文本 | |
data.char_count |
integer | 字符数(按Unicode码点计数) | |
data.byte_count |
integer | 字节总数(UTF-8) | |
data.codepoint |
string | Unicode码点(单字符时) | |
data.utf8_hex |
string | UTF-8字节十六进制 | |
data.html_decimal |
string | HTML十进制实体 | |
data.html_hex |
string | HTML十六进制实体 | |
data.css |
string | CSS content转义 | |
data.js |
string | JavaScript转义(代理对) | |
data.js_es6 |
string | ES6 Unicode转义 | |
data.python |
string | Python转义 | |
data.chars |
array | 所有字符编码详情数组 | |
点击左侧“发送请求”查看结果...