I-Admin
asked on
Freemarker/JSP/Spring
Hi All,
I want to know that If a am changing a Locale from a GUI then If I am trying to print all the Key value pair of properties file It was giving as a ??????? in a console but while debugging it is coming as a some language which I have been selected.
Same If I am trying to show in freemarker page again it is coming like ??????
Please suggest me What to do for this?
I want to know that If a am changing a Locale from a GUI then If I am trying to print all the Key value pair of properties file It was giving as a ??????? in a console but while debugging it is coming as a some language which I have been selected.
Same If I am trying to show in freemarker page again it is coming like ??????
Please suggest me What to do for this?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
What is that?i18prop
(see my earlier comments about the console)System.out.println(map);
ASKER
i18prop is a properties file. I.e for Taiwan it is coming like i18n_zh_TW.
Unicode is written in i18 according to country.
String value = labels.getString(key);
When I am writing System.out.println(value);
It was giving format of Taiwan but when I am writing System.out.println(map)
it was giving correct code but value are coming like ??????;
and because I am using This map to my freemarker page to get value to the corresponding key in that also it was coming as ?????
Hope I have explained all you want!
here It is getting a data from a i18 file
Unicode is written in i18 according to country.
String value = labels.getString(key);
When I am writing System.out.println(value);
It was giving format of Taiwan but when I am writing System.out.println(map)
it was giving correct code but value are coming like ??????;
and because I am using This map to my freemarker page to get value to the corresponding key in that also it was coming as ?????
Hope I have explained all you want!
here It is getting a data from a i18 file
ASKER
public Map display() {
UserSession us;
//lang is coming from GUI from the previous page
String lang = (String) Catalog.getRequest().getSe
.getAttribute("lang");
Locale currentLocale;
currentLocale = new Locale(Constant.SESSION_LA
ResourceBundle labels = ResourceBundle.getBundle(i
Enumeration bundleKeys = labels.getKeys();
Map map = new HashMap();
while (bundleKeys.hasMoreElement
String key = (String) bundleKeys.nextElement();
String value = labels.getString(key);
map.put(key, value);
}
System.out.println(map);
return map;
}
Now This map I want to use in freemarker page It is showing like ????
same for the console
But If i am debugging it and using (ctrl+shift+i) for map it is giving the same character for the language