China DOS Union

-- Unite DOS · Advance DOS · Grow DOS --

Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum
DOS stands for freedom, openness and progress. Let us work hard, learn from the openness and GNU spirit of FreeDOS and Linux, and together build and grow a free GNU GPL world!

中国DOS联盟论坛
The time now is 2026-08-02 02:26
中国DOS联盟论坛 » DOS批处理 & 脚本技术(批处理室) » How to input ASCII code but output character? View 1,580 Replies 6
Original Poster Posted 2006-09-14 01:10 ·  中国 广东 佛山 电信
初级用户
Credits 36
Posts 10
Joined 2006-09-13 11:44
19-year member
UID 62492
Status Offline
How to input ASCII code but output the character?
Floor 2 Posted 2006-09-14 01:47 ·  中国 广东 佛山 电信
初级用户
Credits 36
Posts 10
Joined 2006-09-13 11:44
19-year member
UID 62492
Status Offline
Floor 3 Posted 2006-09-14 01:51 ·  中国 广东 佛山 广东睿江科技有限公司
荣誉版主
★★★★
batch fan
Credits 5,226
Posts 1,737
Joined 2006-03-10 00:38
20-year member
UID 51697
From 成都
Status Offline
Please check whether the question in the top post is clearly described before continuing to ask questions.
尺有所短,寸有所长,学好CMD没商量。
考虑问题复杂化,解决问题简洁化。
Floor 4 Posted 2006-09-14 07:30 ·  中国 广东 佛山 电信
初级用户
Credits 36
Posts 10
Joined 2006-09-13 11:44
19-year member
UID 62492
Status Offline
It means converting a character to ASCII, and then using CMD to convert it back to the character for output. For example, the ASCII of 'a' is 110001. Then you would input 110001 in CMD, but the output would be 'a'.

I wonder if it's clear enough.
Floor 5 Posted 2006-09-14 11:42 ·  中国 广西 玉林 博白县 电信
金牌会员
★★★★
Credits 3,687
Posts 1,467
Joined 2005-08-08 12:00
20-year member
UID 44210
Status Offline
Mini Converter for Hexadecimal Character Text/Binary File

Can only convert to file

[ Last edited by zxcv on 2006-9-14 at 11:43 ]
Floor 6 Posted 2006-09-14 12:26 ·  中国 广东 佛山 广东睿江科技有限公司
荣誉版主
★★★★
batch fan
Credits 5,226
Posts 1,737
Joined 2006-03-10 00:38
20-year member
UID 51697
From 成都
Status Offline
I have seen batch scripts for converting between decimal and hexadecimal before. The basic principle is to convert the characters 0-9 in decimal to the corresponding hexadecimal characters. In fact, as long as there is a conversion table, this problem is relatively easy to solve. Unfortunately, I don't know what that conversion table looks like.
尺有所短,寸有所长,学好CMD没商量。
考虑问题复杂化,解决问题简洁化。
Floor 7 Posted 2006-09-14 13:29 ·  中国 广西 玉林 博白县 电信
金牌会员
★★★★
Credits 3,687
Posts 1,467
Joined 2005-08-08 12:00
20-year member
UID 44210
Status Offline
Converting hexadecimal to decimal is very simple: "set /a N=0xFFFF"

Converting between binary, octal, decimal, and hexadecimal is more convenient with batch commands, while conversion tables are quite limited

PS: I found an ASCII to Unicode conversion table online yesterday, which is 145k and has 7445 pairs. After making "set ASCII=UniCode", it took 10 seconds to load; I made a batch file last night and it took 3 hours to convert it to an ASCII to UTF-8 conversion table, which is also over 100k

To display as text, you still need to use the "Mini Converter for Hexadecimal Character Text/Binary File (ASCII)"

[ Last edited by zxcv on 2006-9-14 at 01:34 ]
Forum Jump: