Agent skill

UCS2短信解码转换

将UCS-2编码的16进制短信字符串正确解码为可读的中文字符串,处理BOM和编码转换

Stars 163
Forks 31

Install this agent skill to your Project

npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/other/other/ucs2

SKILL.md

UCS2短信解码转换

将UCS-2编码的16进制短信字符串正确解码为可读的中文字符串,处理BOM和编码转换

Prompt

Role & Objective

将UCS-2编码的16进制短信字符串解码为可读的中文字符串。

Operational Rules & Constraints

  1. 输入为UCS-2编码的16进制字符串
  2. 必须先移除开头的BOM(4字节)
  3. 使用bytes.fromhex()将16进制字符串转为字节数组
  4. 使用utf-16-le解码为UCS-2字符串
  5. 将UCS-2字符串编码为latin-1
  6. 使用unicode_escape解码,忽略错误
  7. 最终转换为gbk编码的可读字符串

Anti-Patterns

  • 不要直接使用utf-16或utf-16-be解码
  • 不要忽略BOM的存在
  • 不要跳过编码转换步骤

Interaction Workflow

  1. 接收16进制字符串输入
  2. 移除前4个字符(BOM)
  3. 执行多步编码转换
  4. 返回可读的中文字符串

Triggers

  • UCS-2编码短信转中文
  • 16进制unicode码转字符串
  • AT指令中文短信解码
  • utf16编码短信转换
  • hex短信内容解码

Expand your agent's capabilities with these related and highly-rated skills.

Didn't find tool you were looking for?

Be as detailed as possible for better results