native2ascii运用
1.native2ascii命令行的格式
native2ascii -[option] [inputfile [outputfile]]
说明:
-[option]:表示命令开关,有两个选项可供选择:
-reverse :将Unicode文件转换成本地或指定编码的文件,不指定编码则默认是本地编码;
-encoding encoding_name:指定编码方式,encoding_name:为编码名称;
[inputfile [outputfile]]
inputfie:表示输入文件的全名;
outputfile:输出文件全名,如果缺省,则输出到控制台。
2.操作方式
2.1 右击开始菜单,点击运行,输入cmd打开控制台;
2.2 在控制台打开Java安装文件下的bin文件,cd java/bin的全路径;
2.3 输入运行native2ascii命令行

3.例如
文件old.properties内容:
user.name=小明123
welcome=Hello
3.1 将old.properties转换成utf-8编码,输出到new.properties文件
native2ascii -encoding utf-8 old.properties new.properties
则new.properties内容:
user.name=\u5c0f\u660e123
welcome=Hello
*编码为目标文件编码
3.2 将new.properties转换回来,输出到n.properties文件
native2ascii -reverse -encoding utf-8 new.properties n.properties
则n.properties内容:
user.name=小明123
welcome=Hello
*编码为源文件的编码
native2ascii运用的更多相关文章
- native2ascii 使用说明
native2ascii.exe 是Java的一个文件转码工具,是将特殊各异的内容转为用指定的编码标准文体形式统一的表现出来,它通常位于JDK_home\bin目录下,安装好Java SE后,可在命令 ...
- native2ascii.exe 字符转码与反转码
本人最近在做OAF的二次开发,在看别人写的代码时,发现总有类似这样的语句:”\u65e0\u6548\u7684GP\u9879\u76ee\u7f16\u53f7“,这些语句其实是用Java_hom ...
- native2ascii 国际资源文件编码
将common_zh_CN.properties 转换为 本地文件 common_zh_CN_src.properties native2ascii -reverse common_zh_CN.pro ...
- native2ascii.exe
native2ascii.exe 是 Java 的一个文件转码工具,是将特殊各异的内容 转为 用指定的编码标准文体形式统一的表现出来,它通常位于 JDK_home\bin 目录下,安装好 Java S ...
- JDK中的native2ascii命令详解
1.native2ascii简介: native2ascii是sun java sdk提供的一个工具.用来将别的文本类文件(比如*.txt,*.ini,*.properties,*.java等等)编码 ...
- Java用native2ascii命令做unicode编码转换
背景:在做Java开发的时候,常常会出现一些乱码,或者无法正确识别或读取的文件,比如常见的validator验证用的消息资源(properties)文件就需要进行Unicode重新编码.原因是java ...
- java提供了native2ascii工具
可以使用这个工具,把中文编码称为ascii码 在命令行输入native2ascii 输入中文 得到数据
- 关于java.util.Properties读取中文乱码的正确解决方案(不要再用native2ascii.exe了)
从Spring框架流行后,几乎根本不用自己写解析配置文件的代码了,但近日一个基础项目(实在是太基础,不能用硕大繁琐的Spring), 碰到了用java.util.Properties读取中文内容(UT ...
- 国际化 native2ascii用法
cmd下输入: native2ascii -encoding GBK(需要编译成哪种语言) (中文文件路劲) (英文文件路劲) 其他固定 例如 native2ascii -encoding GBK C ...
- native2ascii 在 Mac终端的转码
打开终端,输入 native2ascii 回车 然后输入想要转码的 中文 回车 自动会出现 通用的 unicode编码. 默认应该是 utf-8 格式
随机推荐
- cc.Node—Action
1: Action类是动作命令,我们创建Action,然后节点运行action就能够执行Action的动作; 2: Action分为两类: (1) 瞬时就完成的ActionInstant, (2) 要 ...
- pygame 方块随机飞舞动画
import pygame import random # default WIDTH=1280 HEIGHT=1060 FPS=60 sum=0 # set color WHITE=(255,255 ...
- illuminate/routing 源码分析之注册路由
我们知道,在 Laravel 世界里,外界传进来一个 Request 时,会被 Kernel 处理并返回给外界一个 Response.Kernel 在处理 Request 时,会调用 illumina ...
- List lambda 排序
Comparator<PromotionRule> comparator = Comparator.comparing(PromotionRule::getCreatedTime); pr ...
- Maven_在Eclipse中执行Maven命令
- 【Codeforces 9989C】A Mist of Florescence
[链接] 我是链接,点我呀:) [题意] 题意 [题解] 四个大角 然后每个大角里面包着一些其他颜色的就好 [代码] #include <bits/stdc++.h> using name ...
- [luoguP1072] Hankson 的趣味题(数论)
传送门 由题意得 gcd(x, a0) = a1 ——> gcd(x / a1, a0 / a1) = 1 lcm(x, b0) = b1 ——> x * b0 / gcd(x, b0) ...
- Non-inclusive cache method using pipelined snoop bus
A non-inclusive cache system includes an external cache and a plurality of on-chip caches each havin ...
- 试来试去,WIN下最简单的WIN API开发工具,Pelles C就好啦
昨晚试过N个,不是太大,就是不容易和WIN API集成. 今早一试就灵了个.... Pelles C. Pelles C是一款windows下的C IDE,支持调试,且为免费.它有一个高效率的链接器, ...
- C. Star sky 二维前缀和
time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standa ...