360 Secure SkillHub
360 安全技能中心

Urlencode Tool

该 Skill 通过命令行按 RFC 3986 对文本做百分号编码与解码,提供 component、query(表单式,空格转 +)、path-safe 三种模式,支持指定字符集、从文件批量处理、JSON 输出,并声明对 CJK、emoji 等多字节字符的往返安全。

dinghaibin
dinghaibin
热度 29.05
最近更新 2026-05-11 17:48:08
分类:效率依赖:代码执行 / 读写文件应用场景:文件转换

安装技能

复制下面的话术发给你的 Agent,它会通过 secure-skills 检索并安装该技能。

执行命令安装此 skill: npx secure-skills-cli add urlencode-tool
Metadata
name
urlencode-tool
description
URL-encode or decode text for safe transmission in URLs and query strings, with support for form data, partial encoding, and batch file processing.

URL Encode/Decode Tool — Percent-Encoding Utility

Encode and decode URL components per RFC 3986. Handles query strings, path segments, form bodies (application/x-www-form-urlencoded), and partial encoding where only unsafe characters are escaped.

Quick Start

# Encode a string for URL use
urlencode-tool --encode "hello world & more"

# Decode a percent-encoded string
urlencode-tool --decode "hello%20world%20%26%20more"

# Encode a full query string
urlencode-tool --encode "name=Alice & age=30" --query

Usage

urlencode-tool [COMMAND] [TEXT] [OPTIONS]

Commands:
  --encode TEXT   Percent-encode the input string
  --decode TEXT   Decode percent-encoded input

Options:
  --query         Encode as form query (spaces → +)
  --path-safe     Only encode unsafe chars for path segment
  --component     Encode entire URI component (default, full RFC 3986)
  --charset UTF-8 Character encoding (default: UTF-8)
  --batch FILE    Encode/decode lines from a file
  --json          Output as JSON

Examples

# Basic encoding
urlencode-tool --encode "user input with spaces & symbols"

# Decode back
urlencode-tool --decode "user%20input%20with%20spaces%20%26%20symbols"

# Form-encoded query string (spaces as +)
urlencode-tool --encode "name=Alice Smith&city=New York" --query

# Path-segment safe (preserves /)
urlencode-tool --encode "dir/sub dir/file name.txt" --path-safe

# Batch process a file of URLs
urlencode-tool --encode --batch urls.txt --json

Features

  • Encode & decode full RFC 3986 percent-encoding
  • 3 encoding modes: component, query (form), path-safe
  • UTF-8 encoding standard (configurable charset)
  • Batch processing from file input
  • JSON output for script pipelines
  • Round-trip safety: decode(encode(x)) === x for valid Unicode
  • Unicode safe: handles CJK, emoji, and multi-byte characters