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-09 02:24
中国DOS联盟论坛 » DOS批处理 & 脚本技术(批处理室) » How to make Simplified and Traditional systems share one batch file without garbled text View 1,025 Replies 4
Original Poster Posted 2008-06-20 21:14 ·  中国 广东 东莞 电信
初级用户
★★
Credits 118
Posts 52
Joined 2008-05-07 09:39
18-year member
UID 117968
Gender Male
Status Offline
Please give me some pointers:
I wrote a batch file in a Simplified Chinese system, but the Chinese parts can't be recognized in a Traditional Chinese system. This really troubles me, because some computers in our company use Traditional Chinese, some use Simplified Chinese, and some even have dual systems. Is there any way to make my batch file be recognized by both Simplified and Traditional Chinese systems?
I thought about making two versions of the batch file, one Simplified and one Traditional, and then letting the computer decide which one to run: if it's a Simplified Chinese system then execute the Simplified version, otherwise execute the Traditional version. But I don't know how to tell them apart.
Friends who know how, please give me a hand. Thanks in advance!
Floor 2 Posted 2008-06-20 21:45 ·  中国 上海 松江区 电信
铂金会员
★★★★
DOS一根葱
Credits 5,493
Posts 2,315
Joined 2006-05-01 10:41
20-year member
UID 54766
Gender Male
From 上海
Status Offline
第一高手 第二高手

Floor 3 Posted 2008-06-21 12:38 ·  中国 北京 海淀区 联通
银牌会员
★★★
Credits 1,287
Posts 634
Joined 2007-05-02 15:06
19-year member
UID 87277
Gender Male
From cmd.exe
Status Offline
chcp 936 >nul
GRAFTABL 950 >nul
This way, just 1 BAT is enough

But... it seems you need to have 2 code pages.
Floor 4 Posted 2008-06-21 13:25 ·  中国 江苏 苏州 电信
高级用户
★★
五星老土
Credits 558
Posts 172
Joined 2003-02-09 00:00
23-year member
UID 881
Gender Male
From 江苏
Status Offline
chcp|find "936">nul &&set "jt=echo" &set "ft=rem"
chcp|find "950">nul &&set "ft=echo" &set "jt=rem"
rem Do the same by analogy when handling other characters that need to be displayed
%jt% right now it is Simplified
%ft% right now it is Traditional (when actually writing it, use real Traditional characters)
我怎么找不到一个比我注册日期早的人? 难道我是传说中的超级管理员? 其实我只是个潜水冠军而已.
Floor 5 Posted 2008-06-25 20:04 ·  中国 广东 东莞 电信
初级用户
★★
Credits 118
Posts 52
Joined 2008-05-07 09:39
18-year member
UID 117968
Gender Male
Status Offline
Many thanks to the brothers in the posts above, thanks!
Forum Jump: