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

推荐订阅源

C
CERT Recently Published Vulnerability Notes
U
Unit 42
T
The Blog of Author Tim Ferriss
H
Hackread – Cybersecurity News, Data Breaches, AI and More
B
Blog RSS Feed
Microsoft Azure Blog
Microsoft Azure Blog
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
S
Securelist
L
Lohrmann on Cybersecurity
Blog — PlanetScale
Blog — PlanetScale
Recorded Future
Recorded Future
D
DataBreaches.Net
Spread Privacy
Spread Privacy
T
Threat Research - Cisco Blogs
I
Intezer
P
Palo Alto Networks Blog
Simon Willison's Weblog
Simon Willison's Weblog
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
I
InfoQ
宝玉的分享
宝玉的分享
Security Latest
Security Latest
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
T
Threatpost
Cisco Talos Blog
Cisco Talos Blog
P
Proofpoint News Feed
博客园 - 司徒正美
H
Hacker News: Front Page
Y
Y Combinator Blog
爱范儿
爱范儿
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
NISL@THU
NISL@THU
月光博客
月光博客
有赞技术团队
有赞技术团队
Cloudbric
Cloudbric
酷 壳 – CoolShell
酷 壳 – CoolShell
G
Google Developers Blog
A
Arctic Wolf
博客园 - 【当耐特】
W
WeLiveSecurity
V
Visual Studio Blog
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
V
V2EX
C
Cyber Attacks, Cyber Crime and Cyber Security
S
SegmentFault 最新的问题
The GitHub Blog
The GitHub Blog
The Cloudflare Blog
Stack Overflow Blog
Stack Overflow 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