中国DOS联盟论坛

China DOS Union

-- Unite DOS · Advance DOS · Grow DOS --
Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum
Guest | Log in | Register | Members | Search | China DOS Union
中国DOS联盟论坛
The time now is 2026-08-03 18:18
48,038 topics / 350,123 posts / today 0 new / 48,251 members
DOS批处理 & 脚本技术(批处理室) » File encoding conversion
Printable Version  2,252 / 17
Floor1 jdxhyuan Posted 2007-03-09 06:31
初级用户 Posts 11 Credits 26
How to write a batch script to convert UTF-8 encoding to ANSI encoding? Please help, experts.
Floor2 zh159 Posted 2007-03-09 06:37
金牌会员 Posts 1,467 Credits 3,687
Generally, it is best to convert by finding a comparison table method
Floor3 jmz573515 Posted 2007-03-09 07:06
银牌会员 Posts 464 Credits 1,212
The landlord gives an example to see, what is converted into what (a bit confused..) :)
Floor4 electronixtar Posted 2007-03-09 07:23
铂金会员 Posts 2,672 Credits 7,493
It seems that it is directly converted with for.
Floor5 everest79 Posted 2007-03-09 11:49
金牌会员 Posts 1,127 Credits 2,564
Originally posted by electronixtar at 2007-3-8 06:23 PM:
It seems that it can be converted directly with for.


I converted it like this
more utf8.txt >ansi.txt
%cmdspec% /u more ansi.txt >utf8.txt

How to convert with for
Floor6 jdxhyuan Posted 2007-03-09 21:30
初级用户 Posts 11 Credits 26
Who can give me the source code? The problem hasn't been solved yet.
Floor7 pillow Posted 2007-03-09 22:00
初级用户 Posts 82 Credits 196
Can this be achieved with DOS too? So amazing!
I just know there is a software called convertZ that can achieve this function, and it can also do it in batches. LZ, do you want to give it a try?
Floor8 jdxhyuan Posted 2007-03-09 22:09
初级用户 Posts 11 Credits 26
Originally posted by pillow at 2007-3-9 09:00 AM:
?? Can this be achieved with DOS too? So amazing!
I just know there is a software called convertZ that can achieve this function, and it can also do batch processing. LZ, do you want to give it a try?

How to do batch processing for this? Please help.
I usually use Notepad to convert, but I don't know how to do batch processing with Notepad.
Floor9 pillow Posted 2007-03-09 22:10
初级用户 Posts 82 Credits 196
It's not that you can batch convert with Notepad,

It means convertZ can
Floor10 jdxhyuan Posted 2007-03-09 23:57
初级用户 Posts 11 Credits 26
Originally posted by pillow at 2007-3-9 09:10 AM:
It's not that you can use Notepad for batch conversion,

It means that convertZ can

I downloaded this software, but it seems there's no way to write batch processing code. What I need to do is to change the file encoding in the form of a batch file.
Floor11 jdxhyuan Posted 2007-03-09 23:59
初级用户 Posts 11 Credits 26
Originally posted by zh159 at 2007-3-8 05:37 PM:
It is generally best to convert by looking up a comparison table.

Your suggestion is very good. Can you be more detailed?
Floor12 jmz573515 Posted 2007-03-10 01:31
银牌会员 Posts 464 Credits 1,212
You mean how to handle the following?

Attachments
{9CF85646-5EEF-48EA-AA47-D1BC862DA4C7}.BMP (24.08 KiB)
Floor13 HUNRYBECKY Posted 2007-03-10 01:39
银牌会员 Posts 442 Credits 1,179
Using the TYPE command is the simplest: type c:\u8.txt > c:\a.txt
Floor14 electronixtar Posted 2007-03-10 01:58
铂金会员 Posts 2,672 Credits 7,493
So it was type, I mistook it for for.
Floor15 jdxhyuan Posted 2007-03-10 05:30
初级用户 Posts 11 Credits 26
Originally posted by HUNRYBECKY at 2007-3-9 12:39 PM:
The simplest way to use the TYPE command: type c:\u8.txt >c:\a.txt

This only achieves outputting the content of u8.txt to a.txt, which is similar to renaming the file.
1 2  Next
[ Contact the Union admin team - 中国DOS联盟 - Standard version ]
Sponsored by ifanr Inc | © 2001–2023