Convert Chinese characters to ASCII code

Source: Internet
Author: User

In DOS

Native2ascii resources_src.properties resources_zh_tw.properties

UTF-8 translation tools with Chinese: Native2ascii.exe | 06-9-8 5:27

Java came with a coded conversion tool, Native2ascii.exe, in the Java Bin directory, such as:/jdk1.5.0_07/bin/native2ascii.exe.
If Java is installed, it can be executed directly under DOS commands. If it is not installed, you will need to set or write the full path in the paths, otherwise DOS cannot find the file. However, if there are no additional parameters at execution time, the result is waiting for input, so there is no display.
However, if you simply typed three parameters, you can see the description of the operation parameters:
C:/Documents and settings/administrator/desktop >native2ascii arg1 arg2 arg3
Usage: native2ascii [-reverse] [-encoding encoding] [input file [output file]]

So, for the liferay translation is too bad, sometimes want to modify, a total of three files involved.
Language.properties--Original English
Language_zh_cn.properties--Chinese UTF-8 format, need special tools to view
Language_zh_CN.properties.native--Chinese, readable
They are in the content directory in the Portal-ejb.jar package, you can use WinZip to extract the modified and then add back.

The method of specific modification:
1, traditional-simplified, with Word open Language_zh_CN.properties.native, select All, and then click the toolbar in the conversion button, and then make the necessary changes (can refer to pure English language.properties), Save as plain text format.
2. Code conversion:
C:/Documents and settings/administrator/desktop >native2ascii-encoding UTF-8 Language_zh_CN.properties.native Language _zh_cn.properties
3, then compress the file back to the Portal-ejb.jar package, restart the application server or reload the Liferay.

In addition, you can also use other specialized tools to directly edit UTF-8 encoded files, such as: PROPERTIESEDITOR.JNLP, in fact, ultraedit even word, etc. also have to deal with the encoding method, but not too convenient to use.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.