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-12 03:10
中国DOS联盟论坛 » DOS批处理 & 脚本技术(批处理室) » How to save the output txt as Unicode format in batch processing View 1,687 Replies 9
Original Poster Posted 2009-11-06 16:49 ·  中国 上海 电信漕宝路IDC机房
初级用户
Credits 24
Posts 24
Joined 2009-09-21 07:50
16-year member
UID 152383
Gender Male
Status Offline
As the title says. Suppose the following code:
echo hello>1.txt
How to make the 1.txt file save itself in Unicode format (equivalent to the effect of opening 1.txt with Notepad and saving as Unicode format)
If there are relatively convenient third-party DOS programs, please let the DX know, thanks a lot!

[ Last edited by nerfg002 on 2009-11-8 at 10:59 ]
Floor 2 Posted 2009-11-06 22:32 ·  中国 重庆 电信
版主
★★★★★
Credits 9,023
Posts 5,017
Joined 2007-05-31 19:39
19-year member
UID 89899
Gender Male
Status Offline
cmd /u /c echo hello>1.txt
Floor 3 Posted 2009-11-06 23:06 ·  中国 四川 成都 电信
初级用户
★★
Credits 145
Posts 95
Joined 2008-04-12 16:29
18-year member
UID 115703
Gender Male
Status Offline
HAT moderator is just concise... It's shocking! There really is a /U...
Floor 4 Posted 2009-11-07 00:06 ·  中国 上海 电信
初级用户
Credits 24
Posts 24
Joined 2009-09-21 07:50
16-year member
UID 152383
Gender Male
Status Offline
Thank you very much for the reply from moderator HAT, but the problem is still not solved. Although the output through the pipe is UNICODE characters, the format of the 1.txt file is still ASCII after writing.

[ Last edited by nerfg002 on 2009-11-7 at 00:33 ]
Floor 5 Posted 2009-11-07 10:43 ·  中国 重庆 电信
版主
★★★★★
Credits 9,023
Posts 5,017
Joined 2007-05-31 19:39
19-year member
UID 89899
Gender Male
Status Offline
What the 3rd floor said is okay, and my test result here is also correct. Is it that your test steps are incorrect?
Floor 6 Posted 2009-11-07 18:44 ·  中国 上海 电信漕宝路IDC机房
初级用户
Credits 24
Posts 24
Joined 2009-09-21 07:50
16-year member
UID 152383
Gender Male
Status Offline
Thanks for the help! Everyone helps!

[ Last edited by nerfg002 on 2009-11-8 at 15:39 ]
Floor 7 Posted 2009-11-07 20:17 ·  中国 广东 韶关 电信
高级用户
★★★
CMD感染者
Credits 691
Posts 383
Joined 2008-05-23 00:38
18-year member
UID 119451
Gender Male
Status Offline
Originally posted by nerfg002 at 2009-11-6 04:49 PM:
How to make the 1.txt file save itself as Unicode format (equivalent to the effect of opening 1.txt with Notepad and saving it as Unicode format)



Originally posted by nerfg002 at 2009-11-7 06:44 PM:
Maybe the moderator doesn't quite understand my intention or there is a problem with my system. I have solved it myself. Thank you for your help.
Share the method:
Create a new blank text file 2.txt and open it with Notepad, then save it as Unicode format, and then ...


LZ is awesome, solved it by himself like this.!!!
Floor 8 Posted 2009-11-07 21:04 ·  中国 四川 成都 电信
初级用户
★★
Credits 145
Posts 95
Joined 2008-04-12 16:29
18-year member
UID 115703
Gender Male
Status Offline
Helplessly drifting by...
Floor 9 Posted 2009-11-08 23:25 ·  中国 湖南 长沙 电信
新手上路
Credits 18
Posts 17
Joined 2008-11-07 22:13
17-year member
UID 130325
Gender Male
Status Offline
Please provide the specific Chinese content that needs to be translated so that I can assist you.
Floor 10 Posted 2010-10-03 22:39 ·  中国 广西 来宾 电信
初级用户
Credits 67
Posts 40
Joined 2007-11-05 20:02
18-year member
UID 101808
Gender Male
Status Offline
Oh, is that okay? I'll give it a try
Forum Jump: