Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Velocity template unable to get Chinese character correctly

800332Apr 25 2005 — edited Feb 8 2006
Hi ter,

I was trying to set Chinese character to velocity template but when the user received the email, all the Chinese characters become ????? ! I use

public static String getBundleMessage(String key){
FacesContext context = FacesContext.getCurrentInstance();
ResourceBundle bundle = ResourceBundle.getBundle(resourceFile,context.getViewRoot().getLocale());
return bundle.getString(key);
}

to get the bundle message from registration_zh.properties file like
userid=\u7528\u6237\u540d
first_name=\u540d\u5b57

Please help, Thanks in advance !
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Mar 8 2006
Added on Apr 25 2005
4 comments
344 views