Displaytag Chinese garbled characters

Source: Internet
Author: User
I used displaytag today. It's a good thing. There are some problems with Chinese support. I modified some settings in displaytag. properties, including some Chinese characters, such as the paging. Banner. item_name = record. Garbled characters are displayed. You cannot change the configuration file to displaytag_zh.properties or displaytag_zh_cn.properties. The configuration file cannot be changed to UTF-8 encoding. At the moment, I couldn't find a good solution on the Internet. I had to make a copy. Code , Modify org. displaytag. properties. tableproperties

Private string getproperty (string key)
{
Return this. properties. getproperty (key );
}

Change
Private string getproperty (string key)
{
String S = NULL;
Try {
S = new string (this. properties. getproperty (key). getbytes ("8859_1"), "GBK ");
} Catch (exception e ){
S = NULL;
}
Return S;
}

Compile and try again. The solution is just a bit confusing. Let's join it first.

My environment is Windows Chinese + Sun JDK 1.42 + Tomcat 5.0.28 + displaytag 1.0

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.