Page Actions
Wiki Actions
User Actions
Submit This Story

recode tips

Say good-bye to iconv!

tips

#显示所有有效的字符集及其别名
recode -l | less
 
#转换Windows下的ansi文件到当前的字符集(自动进行回车换行符的转换)
recode windows-1252.. file_to_change.txt
 
#转换Windows下的ansi文件到当前的字符集
recode utf-8/CRLF.. file_to_change.txt
 
#转换Latin9(西欧)字符集文件到utf8
recode iso-8859-15..utf8 file_to_change.txt
 
#Base64编码
recode ../b64 < file.txt > file.b64
 
#Quoted-printable格式解码
recode /qp.. < file.txt > file.qp
 
#将文本文件转换成HTML
recode ..HTML < file.txt > file.html
 
#在字符表中查找某符号(e.g.欧元)
recode -lf windows-1252 | grep euro
 
#显示字符在latin-9中的字符映射
echo -n 0x80 | recode latin-9/x1..dump
 
#显示latin-9编码
echo -n 0x20AC | recode ucs-2/x2..latin-9/x
 
#显示utf-8编码
echo -n 0x20AC | recode ucs-2/x2..utf-8/x

Discussion

Jennica, 2012/01/06 10:38

Hey, that's the geartest! So with ll this brain power AWHFY?

Enter your comment
 
 
blog/2009/10/recode_tips.txt · Last modified: 2009/10/01 00:00 (external edit)     Back to top
Recent changes RSS feed Creative Commons License Powered by PHP Driven by DokuWiki