惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
D
Darknet – Hacking Tools, Hacker News & Cyber Security
N
News and Events Feed by Topic
N
News | PayPal Newsroom
SecWiki News
SecWiki News
P
Privacy International News Feed
T
Troy Hunt's Blog
Attack and Defense Labs
Attack and Defense Labs
N
News and Events Feed by Topic
L
LINUX DO - 热门话题
www.infosecurity-magazine.com
www.infosecurity-magazine.com
Security Latest
Security Latest
AWS News Blog
AWS News Blog
S
Secure Thoughts
W
WeLiveSecurity
H
Heimdal Security Blog
T
Threat Research - Cisco Blogs
I
Intezer
Application and Cybersecurity Blog
Application and Cybersecurity Blog
S
Security @ Cisco Blogs
G
GRAHAM CLULEY
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
Spread Privacy
Spread Privacy
L
Lohrmann on Cybersecurity
C
CERT Recently Published Vulnerability Notes
S
Security Affairs
Hacker News - Newest:
Hacker News - Newest: "LLM"
Google Online Security Blog
Google Online Security Blog
Cisco Talos Blog
Cisco Talos Blog
雷峰网
雷峰网
Cloudbric
Cloudbric
Y
Y Combinator Blog
酷 壳 – CoolShell
酷 壳 – CoolShell
博客园_首页
Hacker News: Ask HN
Hacker News: Ask HN
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
Google DeepMind News
Google DeepMind News
Vercel News
Vercel News
云风的 BLOG
云风的 BLOG
Latest news
Latest news
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
D
Docker
Recent Announcements
Recent Announcements
博客园 - 【当耐特】
H
Help Net Security
博客园 - 司徒正美
TaoSecurity Blog
TaoSecurity Blog
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
C
Check Point Blog
博客园 - 叶小钗

博客园 - Icebird

谈谈批处理文件里的注释 在.NET中使用PhysFS来挂载压缩包(zip) 用户中心 - 博客园 Password for ReportBuilder Enterprise v10.08 Retail For Delphi 7-Lz0 [Delphi] DUnitID 0.17.4725 RSSReader JavaScript Edition [Delphi] GetClass与RegisterClass的应用一例 DelForEx v2.5 for Delphi 2007 我的Delphi开发经验谈 JBookManager v1.00.2008314 (编辑管理您的Jar电子书) Windows优化大师的一点研究 [Delphi] 发布QuickenPanel Component LINQ to JavaScript [PowerShell] SFV生成与校验 [PowerShell] 将rar文件转换为zip格式 [PowerShell] PowerShell学习脚印 JavaScript测试页面 DevExpress ExpressScheduler 快速编译批处理文件 备份工具 SmartBackup的源代码
[PowerShell] GBK简繁转换
Icebird · 2008-02-13 · via 博客园 - Icebird

一个完全用PS实现的脚本,执行后会在全局函数表增加2个自定义函数chs2cht和cht2chs

让这个脚本成为学习PowerShell的良好开端

注释:

1.这里转换的是GBK码中的繁简体,与Word中的繁简体转化功能类似,不是GB和BIG5码的转换

2.转换准确度依赖于内置的对照表(CHS2CHT_Phrase & $Word),如果发现有不能正确的转换的字词,可以自行修改对照表

3.代码移植于我自己写的C#的类,你可以在http://www.cnblogs.com/Icebird/archive/2007/03/29/SubTool.html的源代码里找到HZHelper.cs以及对照表DICT.TXT

4.PowerShell很强大,我会继续研究更多的PS应用并与大家分享

脚本下载:https://files.cnblogs.com/Icebird/CHS2CHT.rar

演示如下:

举例:如果你希望转换一个文本文件,则可以这样输入:

type 简体.txt | % { chs2cht($_) } > 繁体.txt
type 繁体.txt | % { cht2chs($_) } > 简体.txt