文本到十进制
轻松将文本转换为十进制表示
转换器工具
Enter text to convert to decimal values. Choose between UTF-8 (supports all characters) and ASCII (only 128 characters). Options to add spaces between decimal values are available.
转换表:
Character | 十进制值 |
---|
关于文本到十进制转换
文本编码
文本字符在计算机中由数字表示。不同的编码系统使用不同的字符数字:
ASCII
The ASCII (American Standard Code for Information Interchange) encoding uses 7 bits to represent 128 characters, including English letters (both uppercase and lowercase), digits, and common punctuation symbols. Each ASCII character can be represented by a unique number between 0 and 127.
UTF-8
UTF-8 是可变长度的字符aracter 编码,它可以表示 Unicode 标准中的每个字符。它为每个字符使用 1 到 4 个字节。UTF-8 向后兼容 ASCII,这意味着前 128 个 UTF-8 字符与 ASCII 相同。
转换过程
将文本转换为十进制包括以下步骤:
- Determine the numerical value of each character using the chosen encoding (ASCII or UTF-8).
- Convert each character to its corresponding decimal (base-10) value.
- (可选)用空格分隔每个十进制值以提高可读性。
示例:将“Hi”转换为十进制
Step 1: Convert each character to its numerical value (ASCII):
H → 72
i → 105
Step 2: Combine the decimal values (with spaces):
72 105
用法说明
- When using ASCII encoding, any character outside the 7-bit ASCII range (128-255) will be converted to a question mark (?).
- UTF-8 编码支持所有 Unicode 字符,包括特殊符号、表情符号和非英语语言中的字符。
- 如果每个 UTF-8 字符使用多个字节,则可以由多个十进制值表示。
- 十进制值通常用于计算数值运算和数据表示。