中国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-19 10:09
47,814 topics / 349,908 posts / today 0 new / 48,259 members
DOS批处理 & 脚本技术(批处理室) » Command-Line GB2312, UTF-8, Unicode, BIG5 Encoding Conversion Tool VBS Version (Updated December 2007)
Printable Version  18,667 / 64
Floor1 fastslz Posted 2007-12-05 14:41
铂金会员 Posts 2,315 Credits 5,493 From 上海

Demo
echo "ABCDE &!@#$ ^<>() %% abcde Test!"> "Before Processing.txt"
GB2Ue.vbs "Before Processing.txt" "After Processing.txt" /y
Ue2U8.vbs "After Processing.txt"
U82GB.vbs "After Processing.txt"
GB2U8.vbs "After Processing.txt"
U82Ue.vbs "After Processing.txt"
Ue2GB.vbs "After Processing.txt"
@echo After 6 processing steps, "After Processing.txt" and "Before Processing.txt" still have the same encoding


Encoding Query Tool QueryCode.vbs
http://www.cn-dos.net/forum/viewthread.php?tid=36012&fpage=1&highlight=

[ Last edited by fastslz on 2007-12-9 at 11:24 PM ]

Attachments
CodeToos.rar (15.19 KiB)
Floor2 s11ss Posted 2007-12-05 16:36
银牌会员 Posts 566 Credits 2,098
Thanks for sharing, let's study it.
Floor3 electronixtar Posted 2007-12-06 14:45
铂金会员 Posts 2,672 Credits 7,493
Function WriteToFile (Getfile, Str, CharSet)
Set stm = CreateObject("Adodb.Stream")
stm.Type = 2
stm.mode = 3
stm.charset = CharSet
stm.Open
stm.WriteText Str
stm.SaveToFile Getfile,2
stm.flush
stm.Close
Set stm = Nothing
End Function

It is indeed this section, heh.
Floor4 fastslz Posted 2007-12-09 23:30
铂金会员 Posts 2,315 Credits 5,493 From 上海
Update:
Enhanced usability to prevent unnecessary losses caused by user misoperations, and added a function to verify the correctness of the input file encoding.
Floor5 laomeng Posted 2007-12-10 23:03
新手上路 Posts 5 Credits 10
Expert, your skills are excellent. I will visit here more often in the future. I haven't used DOS for many years, so I've become quite rusty.
Floor6 prcjie Posted 2007-12-20 16:51
新手上路 Posts 1 Credits 2
Let's try downloading it~~ I've been looking for similar tools for a long time~ Thank you
Floor7 qzwqzw Posted 2007-12-20 20:01
银牌会员 Posts 636 Credits 2,343
Who has time to write a pure DOS version? In the past two days, I tried to browse emails under DOS, and the full page of MIME characters is really worrying.
Floor8 yongfa365 Posted 2007-12-23 14:24
初级用户 Posts 11 Credits 23
The function CheckCode can only judge files with BOM
Floor9 fastslz Posted 2007-12-23 18:41
铂金会员 Posts 2,315 Credits 5,493 From 上海
In the UCS encoding, there is a character called "ZERO WIDTH NO-BREAK SPACE" whose encoding is FEFF. And FFFE is a non-existent character in UCS, so it should not appear in actual transmission. The UCS specification suggests that we transmit the character "ZERO WIDTH NO-BREAK SPACE" before transmitting the byte stream. Then if the receiver receives FEFF, it indicates that this byte stream is Big-Endian; if it receives FFFE, it indicates that this byte stream is Little-Endian. Therefore, the character "ZERO WIDTH NO-BREAK SPACE" is also called BOM.

UTF-8 does not need BOM to indicate the byte order, but can use BOM to indicate the encoding method. The UTF-8 encoding of the character "ZERO WIDTH NO-BREAK SPACE" is EF BB BF. So if the receiver receives a byte stream starting with EF BB BF, it knows that this is UTF-8 encoding.

Windows uses BOM to mark the encoding method of text files.
Floor10 yongfa365 Posted 2007-12-23 21:06
初级用户 Posts 11 Credits 23
There are many problems with BOM in many places. I don't like this BOM.
Floor11 fastslz Posted 2007-12-24 01:43
铂金会员 Posts 2,315 Credits 5,493 From 上海
When replying to the 9th floor, I was in a hurry and didn't notice that it was actually the expert柳永法(yongfa365). I have benefited a lot from your Blog, and I have also learned a lot from your CodeChange.vbs code.
Floor12 fastslz Posted 2007-12-24 01:47
铂金会员 Posts 2,315 Credits 5,493 From 上海
Originally posted by qzwqzw at 2007-12-20 20:01:
Who has time to write a pure DOS version?

I've been trying to browse emails under DOS these past two days, and the full page of MIME characters is really worrying me.


Pure DOS: P pure CMD? Give a thought.
Floor13 Rayz Posted 2008-01-16 16:37
新手上路 Posts 7 Credits 14
Good stuff, I've downloaded it, thanks for sharing
Floor14 sheercony Posted 2008-02-18 13:43
新手上路 Posts 1 Credits 2
Great! This is really a good thing
Floor15 35799 Posted 2008-03-07 01:43
新手上路 Posts 7 Credits 14
Thank you. Can the owner help me change the extension of the converted file to htm at the same time? Because my Sony Ericsson mobile phone can view UTF-8 format htm (for reading books).

[ Last edited by 35799 on 2008-3-7 at 01:46 AM ]
1 2 3 45  Next
[ Contact the Union admin team - 中国DOS联盟 - Standard version ]
Sponsored by ifanr Inc | © 2001–2023