DisplayTAG Chinese garbled

xiaoxiao2021-03-06  23

Use DisplayTag today, very good thing. It is some questions about Chinese support. I have modified some settings in DisplayTag.properties, including some Chinese, such as paging.banner.item_name = record. When it is displayed, it will be garbled. Change the configuration file to displaytag_zh.properties or displaytag_zh_cn.properties is not possible. The configuration file is changed to UTF-8 coding. I didn't find a good way in the Internet. I have to get a code, modify org.displaytag.properties.TableProperties,

Private string getProperty (String Key)

{

Return this.properties.getProperty (key);

}

Change to

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;

}

After compiling, you can try it. The way is really awkward, first let go.

My environment is Windows Chinese Sun JDK 1.42 Tomcat 5.0.28 DisplayTag 1.0

转载请注明原文地址:https://www.9cbs.com/read-70323.html

New Post(0)