native2ascii转码工具的使用
native2ascii转码工具是JDK自带的一种,方便我们将非unicode的编码文件转为unicode格式的文件,位置一般是位于JAVA_HOME/bin目录下。
Why?
语法格式:
native2ascii -[options] [intputfile] [outputfile]
语法格式说明:
-[options]:表示命令开关,有两个选项可供选择
-reverse:将Unicode编码转为本地或者指定编码,不指定编码情况下,将转为本地编码。
-encoding encoding_name:转换为指定编码,encoding_name为编码名称。
[inputfile [outputfile]]
inputfile:表示输入文件全名。
outputfile:输出文件名。如果缺少此参数,将输出到控制台。
举例说明:
1.不指定输出文件的输出位置,打印在当前的dos界面
2. 将指定的文件输出转为unicode码到当前目录下的new.properties文件中
native2ascii old.properties new.properties
3.将当前的unicode码的文件new.properties转为本地编码的old.properties
native2ascii new.properties old.properties
注意:前三种的写法都是采用的是相对路径,我们需要在cd 到dos界面下,执行native2ascii old.properties new.properties命令,比较麻烦
另外我们提供一种比较简便的方法.用.bat来代替执行.
4.自定义一个目录,提供两个bat文件,双击执行就ok
change.bat
D:\Java\bin\native2ascii F:\国际化\old.properties F:\国际化\new.properties
ReturnChange.bat
D:\Java\bin\native2ascii -reverse F:\国际化\new.properties F:\国际化\old.properties
注意:针对数字跟字母,转换前后一致。
衍生阅读:
Basic Encoding Set (contained in lib/rt.jar)
Supported by java.nio, java.io and java.lang APIs
Canonical Name for java.nio API |
Canonical Name for java.io and java.lang API |
Description |
---|---|---|
US-ASCII |
ASCII |
American Standard Code for Information Interchange |
windows-1250 |
Cp1250 |
Windows Eastern European |
windows-1251 |
Cp1251 |
Windows Cyrillic |
windows-1252 |
Cp1252 |
Windows Latin-1 |
windows-1253 |
Cp1253 |
Windows Greek |
windows-1254 |
Cp1254 |
Windows Turkish |
windows-1257 |
Cp1257 |
Windows Baltic |
ISO-8859-1 |
ISO8859_1 |
ISO 8859-1, Latin Alphabet No. 1 |
ISO-8859-2 |
ISO8859_2 |
Latin Alphabet No. 2 |
ISO-8859-4 |
ISO8859_4 |
Latin Alphabet No. 4 |
ISO-8859-5 |
ISO8859_5 |
Latin/Cyrillic Alphabet |
ISO-8859-7 |
ISO8859_7 |
Latin/Greek Alphabet |
ISO-8859-9 |
ISO8859_9 |
Latin Alphabet No. 5 |
ISO-8859-13 |
ISO8859_13 |
Latin Alphabet No. 7 |
ISO-8859-15 |
ISO8859_15 |
Latin Alphabet No. 9 |
KOI8-R |
KOI8_R |
KOI8-R, Russian |
UTF-8 |
UTF8 |
Eight-bit UCS Transformation Format |
UTF-16 |
UTF-16 |
Sixteen-bit UCS Transformation Format, byte order identified by an optional byte-order mark |
UTF-16BE |
UnicodeBigUnmarked |
Sixteen-bit Unicode Transformation Format, big-endian byte order |
UTF-16LE |
UnicodeLittleUnmarked |
Sixteen-bit Unicode Transformation Format, little-endian byte order |
Not available |
UnicodeBig |
Sixteen-bit Unicode Transformation Format, big-endian byte order, with byte-order mark |
Not available |
UnicodeLittle |
Sixteen-bit Unicode Transformation Format, little-endian byte order, with byte-order mark |
Extended Encoding Set (contained in lib/charsets.jar)
Supported by java.nio, java.io and java.lang APIs
Canonical Name for java.nio API |
Canonical Name for java.io and java.lang API |
Description |
---|---|---|
windows-1255 |
Cp1255 |
Windows Hebrew |
windows-1256 |
Cp1256 |
Windows Arabic |
windows-1258 |
Cp1258 |
Windows Vietnamese |
ISO-8859-3 |
ISO8859_3 |
Latin Alphabet No. 3 |
ISO-8859-6 |
ISO8859_6 |
Latin/Arabic Alphabet |
ISO-8859-8 |
ISO8859_8 |
Latin/Hebrew Alphabet |
windows-31j |
MS932 |
Windows Japanese |
EUC-JP |
EUC_JP |
JISX 0201, 0208 and 0212, EUC encoding Japanese |
x-EUC-JP-LINUX |
EUC_JP_LINUX |
JISX 0201, 0208 , EUC encoding Japanese |
Shift_JIS |
SJIS |
Shift-JIS, Japanese |
ISO-2022-JP |
ISO2022JP |
JIS X 0201, 0208, in ISO 2022 form, Japanese |
x-mswin-936 |
MS936 |
Windows Simplified Chinese |
GB18030 |
GB18030 |
Simplified Chinese, PRC standard |
x-EUC-CN |
EUC_CN |
GB2312, EUC encoding, Simplified Chinese |
GBK |
GBK |
GBK, Simplified Chinese |
ISCII91 |
ISCII91 |
ISCII91 encoding of Indic scripts |
x-windows-949 |
MS949 |
Windows Korean |
EUC-KR |
EUC_KR |
KS C 5601, EUC encoding, Korean |
ISO-2022-KR |
ISO2022KR |
ISO 2022 KR, Korean |
x-windows-950 |
MS950 |
Windows Traditional Chinese |
x-MS950-HKSCS |
MS950_HKSCS |
Windows Traditional Chinese with Hong Kong extensions |
x-EUC-TW |
EUC_TW |
CNS11643 (Plane 1-3), EUC encoding, Traditional Chinese |
Big5 |
Big5 |
Big5, Traditional Chinese |
Big5-HKSCS |
Big5_HKSCS |
Big5 with Hong Kong extensions, Traditional Chinese |
TIS-620 |
TIS620 |
TIS620, Thai |
Extended Encoding Set (contained in lib/charsets.jar)
Supported by java.io and java.lang APIs
Canonical Name |
Description |
---|---|
Big5_Solaris |
Big5 with seven additional Hanzi ideograph character mappings for the Solaris zh_TW.BIG5 locale |
Cp037 |
USA, Canada (Bilingual, French), Netherlands, Portugal, Brazil, Australia |
Cp273 |
IBM Austria, Germany |
Cp277 |
IBM Denmark, Norway |
Cp278 |
IBM Finland, Sweden |
Cp280 |
IBM Italy |
Cp284 |
IBM Catalan/Spain, Spanish Latin America |
Cp285 |
IBM United Kingdom, Ireland |
Cp297 |
IBM France |
Cp420 |
IBM Arabic |
Cp424 |
IBM Hebrew |
Cp437 |
MS-DOS United States, Australia, New Zealand, South Africa |
Cp500 |
EBCDIC 500V1 |
Cp737 |
PC Greek |
Cp775 |
PC Baltic |
Cp838 |
IBM Thailand extended SBCS |
Cp850 |
MS-DOS Latin-1 |
Cp852 |
MS-DOS Latin-2 |
Cp855 |
IBM Cyrillic |
Cp856 |
IBM Hebrew |
Cp857 |
IBM Turkish |
Cp858 |
Variant of Cp850 with Euro character |
Cp860 |
MS-DOS Portuguese |
Cp861 |
MS-DOS Icelandic |
Cp862 |
PC Hebrew |
Cp863 |
MS-DOS Canadian French |
Cp864 |
PC Arabic |
Cp865 |
MS-DOS Nordic |
Cp866 |
MS-DOS Russian |
Cp868 |
MS-DOS Pakistan |
Cp869 |
IBM Modern Greek |
Cp870 |
IBM Multilingual Latin-2 |
Cp871 |
IBM Iceland |
Cp874 |
IBM Thai |
Cp875 |
IBM Greek |
Cp918 |
IBM Pakistan (Urdu) |
Cp921 |
IBM Latvia, Lithuania (AIX, DOS) |
Cp922 |
IBM Estonia (AIX, DOS) |
Cp930 |
Japanese Katakana-Kanji mixed with 4370 UDC, superset of 5026 |
Cp933 |
Korean Mixed with 1880 UDC, superset of 5029 |
Cp935 |
Simplified Chinese Host mixed with 1880 UDC, superset of 5031 |
Cp937 |
Traditional Chinese Host miexed with 6204 UDC, superset of 5033 |
Cp939 |
Japanese Latin Kanji mixed with 4370 UDC, superset of 5035 |
Cp942 |
IBM OS/2 Japanese, superset of Cp932 |
Cp942C |
Variant of Cp942 |
Cp943 |
IBM OS/2 Japanese, superset of Cp932 and Shift-JIS |
Cp943C |
Variant of Cp943 |
Cp948 |
OS/2 Chinese (Taiwan) superset of 938 |
Cp949 |
PC Korean |
Cp949C |
Variant of Cp949 |
Cp950 |
PC Chinese (Hong Kong, Taiwan) |
Cp964 |
AIX Chinese (Taiwan) |
Cp970 |
AIX Korean |
Cp1006 |
IBM AIX Pakistan (Urdu) |
Cp1025 |
IBM Multilingual Cyrillic: Bulgaria, Bosnia, Herzegovinia, Macedonia (FYR) |
Cp1026 |
IBM Latin-5, Turkey |
Cp1046 |
IBM Arabic - Windows |
Cp1097 |
IBM Iran (Farsi)/Persian |
Cp1098 |
IBM Iran (Farsi)/Persian (PC) |
Cp1112 |
IBM Latvia, Lithuania |
Cp1122 |
IBM Estonia |
Cp1123 |
IBM Ukraine |
Cp1124 |
IBM AIX Ukraine |
Cp1140 |
Variant of Cp037 with Euro character |
Cp1141 |
Variant of Cp273 with Euro character |
Cp1142 |
Variant of Cp277 with Euro character |
Cp1143 |
Variant of Cp278 with Euro character |
Cp1144 |
Variant of Cp280 with Euro character |
Cp1145 |
Variant of Cp284 with Euro character |
Cp1146 |
Variant of Cp285 with Euro character |
Cp1147 |
Variant of Cp297 with Euro character |
Cp1148 |
Variant of Cp500 with Euro character |
Cp1149 |
Variant of Cp871 with Euro character |
Cp1381 |
IBM OS/2, DOS People's Republic of China (PRC) |
Cp1383 |
IBM AIX People's Republic of China (PRC) |
Cp33722 |
IBM-eucJP - Japanese (superset of 5050) |
ISO2022_CN_CNS |
CNS11643 in ISO 2022 CN form, Traditional Chinese (conversion from Unicode only) |
ISO2022_CN_GB |
GB2312 in ISO 2022 CN form, Simplified Chinese (conversion from Unicode only) |
JISAutoDetect |
Detects and converts from Shift-JIS, EUC-JP, ISO 2022 JP (conversion to Unicode only) |
MS874 |
Windows Thai |
MacArabic |
Macintosh Arabic |
MacCentralEurope |
Macintosh Latin-2 |
MacCroatian |
Macintosh Croatian |
MacCyrillic |
Macintosh Cyrillic |
MacDingbat |
Macintosh Dingbat |
MacGreek |
Macintosh Greek |
MacHebrew |
Macintosh Hebrew |
MacIceland |
Macintosh Iceland |
MacRoman |
Macintosh Roman |
MacRomania |
Macintosh Romania |
MacSymbol |
Macintosh Symbol |
MacThai |
Macintosh Thai |
MacTurkish |
Macintosh Turkish |
MacUkraine |
Macintosh Ukraine |
参考链接:1.http://www.cr173.com/html/26685_1.html
2.http://blog.csdn.net/love_xsq/article/details/41911681
native2ascii转码工具的使用的更多相关文章
- CentOS6下基于Nginx搭建mp4/flv流媒体服务器(可随意拖动)并支持RTMP/HLS协议(含转码工具)
1.先添加几个RPM下载源 1.1)安装RPMforge的CentOS6源 [root@AY130611215205Z ~]# wget -c http://pkgs.repoforge.or ...
- 二维码工具类 - QrcodeUtils.java
二维码工具类,提供多种生成二维码.解析二维码的方法,包括中间logo的二维码等方法. 源码如下:(点击下载 - QrcodeUtils.java.MatrixToImageWriterEx.java. ...
- 码工具通过ICP备案
5月22日,为广大程序员造福的在线工具--码工具 通过了ICP备案,这也意味着本站也越来越正规化,规范化.大家从今日起就可以在网站底部看到本站的ICP备案号. 备案/许可证编号:粤ICP备170597 ...
- Ubuntu 14.10下基于Nginx搭建mp4/flv流媒体服务器(可随意拖动)并支持RTMP/HLS协议(含转码工具)
Ubuntu 14.10下基于Nginx搭建mp4/flv流媒体服务器(可随意拖动)并支持RTMP/HLS协议(含转码工具) 最近因为项目关系,收朋友之托,想制作秀场网站,但是因为之前一直没有涉及到这 ...
- Linux 文件格式转码工具
Linux 系统下文件编码转换格式工具 ICONV 下载 https://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.15.tar.gz 源码安装: $ ./con ...
- java二维码工具类,中间带LOGO的,很强大
jar包下载maven 配置: Xml代码 收藏代码 <dependency> <groupId>com.google.zxing</groupId> <ar ...
- Java 字符串转码工具类
StringConvertUtils.java package javax.utils; /** * 字符串转码工具类 * * @author Logan * @createDate 2019-04- ...
- Java使用Zxing生成、解析二维码工具类
Zxing是Google提供的关于条码(一维码.二维码)的解析工具,提供了二维码的生成与解析的方法. 1.二维码的生成 (1).将Zxing-core.jar 包加入到classpath下. (2). ...
- 在线获取键盘按键值(ascii码)工具
在线获取键盘按键值(ascii码)工具 http://www.bejson.com/othertools/keycodes/ 可以根据输入的值获取对应的键盘ascii码值
随机推荐
- BZOJ1858 [Scoi2010]序列操作(线段树)
题目链接 [Scoi2010]序列操作 考验代码能力的一道好题. 思想还是很简单的(直接上线段树),但是比较难写. #include <bits/stdc++.h> using names ...
- SpringBoot优雅的全局异常处理
前言 本篇文章主要介绍的是SpringBoot项目进行全局异常的处理. SpringBoot全局异常准备 说明:如果想直接获取工程那么可以直接跳到底部,通过链接下载工程代码. 开发准备 环境要求 JD ...
- 集合点-Jmeter-集合点详解
集合点:简单来理解一下,虽然我们的“性能测试”理解为“多用户并发测试”,但真正的并发是不存在的,为了更真实的实现并发这感念,我们可以在需要压力的地方设置集合点, 还拿那个用户和密码的地方,每到输入用户 ...
- Spring Cloud Stream介绍-Spring Cloud学习第八天(非原创)
文章大纲 一.什么是Spring Cloud Stream二.Spring Cloud Stream使用介绍三.Spring Cloud Stream使用细节四.参考文章 一.什么是Spring Cl ...
- shell实现自动备份整个数据库,一个库备份一个文件
自动实现备份整个数据库 实现一个库备份一个文件 实现排除不需要备份的库 实现备份成压缩文件 实现定义保留多少天的备份文件 核心代码 #!/bin/bash #set -x ############## ...
- jquery dataTable 获取某行数据
DataTable API table.row(rowSelector [,modifier]) 注table是dataTable的对象 该方法有两个默认参数 第一个是选择器 第二个是可选的 请注意, ...
- Docker 创建image
images 是containers的基础.每次使用docker run 命令都要指定image. 列出本地images zane@zane-V:~$ docker images REPO ...
- EasyMvc入门教程-入门
1.EasyMvc简介 EasyMvc主要是为了丰富asp.net core mvc控件而出现的: 它提倡简单,面向对象式开发,希望能快速开发的同时,仍然保持一定的灵活性. 2.EasyMvc初相识 ...
- 【J2SE高速进阶】——多线程之synchronized
我和老婆去银行取钱 有一天,和老婆打了个赌.如今我的银行账号里共同拥有5000块钱.我们去银行同一时候取钱,看我俩能不能同一时候取出5000来....(PS:打赌的代价是:假设都能取出5000,那这1 ...
- 立体3D方式 【转】
目前为止,至少有四种普遍使用的立体3D传输格式,分别称为frame sequential(帧连续),frame packing(帧封装),side-by-side(并排),以及checkerboard ...