---
title: "native2ascii转换中文properties文件"
author: "harbey"
date: "2009-04-13T20:37:31Z"
tags: []
slug: "native2ascii-properties"
draft: false
lastmod: "2009-04-13T20:37:31Z"
id: 366779
url: "https://harbey.iteye.com/blog/366779"
---

问题描述：
在property文件中的中文，如果不经过encode的话，会以乱码的形式呈现；
解决办法：
可以通过${java_home}/jdk/bin下的native2ascii.exe来encode中文；
例如：
在dos下输入：
native2ascii ApplicationResources.properties ApplicationResources_zh_CN.properties
这样就将中文encode成类似如下的字符串：
errors.invalid={0} \u65E0\u6548\u3002