[Jstl] How to Use localized resource files

Source: Internet
Author: User

Take basename as an example.

The following is the Chinese file messages_zh_cn.properties.src in UTF-8:

Name = James
Sex = male
City = Beijing
Menu_return = return to the main menu

Step 1: First confirm that the original file is encoded in GB/GBK (important). If it is UTF-8, convert it to GB/GBK first;

Step 2: use $ JDK/bin/native2ascii.exe for conversion

> Native2ascii messages_zh_cn.properties.src> messages_zh_cn.properties

The actual output is as follows:

Name = \ u5f20 \ u4e09
Sex = \ u7537
City = \ u5317 \ u4eac
Menu_return = \ u8fd4 \ u56de \ u4e3b \ u83dc \ u5355

The output is not visible because the file is redirected.

The above content is the content of your localized resource file messages_zh_cn.properties.

Note: An empty line is required at the end of the. properties file to be correctly converted by native2ascii.

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.