E
eeyimaya
Hi,
I am developing a web application in Turkish, with java and
encountered some encoding problems.
I think, I have to encode all my pages with utf-8 if I read my
contents from files(XML, ApplicationResources.properties... etc).???
When I used struts; I keep all my labels and messages in
ApplicationResources.properties file but Turkish characters are not
displayed even I used a filter that sets the encoding to ISO-8859-9. I
used the following to read from ApplicationResources.properties:
<bean:message key="link.employee.helloWorld"/>
When I used JSTL to read xml files, again Turkish characters are not
displayed.
I read XML with the following:
<c:import var="xml" url="/conf/menu.xml" />
<xarse var="dom" doc="${xml}" />
.....
<x:forEach var="menu" select="$dom/firma/menu" varStatus="status">
<x: out select="./@id" />
.....
</x:forEach>
......
I tried native2ascii tool with my struts application and problem is
solved. But since this is very tiring.(well, at least not practical
because my application is not an I18N application. only Turkish), I
did not try for JSTL.
So, I have 4 ways:
1) I don't use java (I want to use java)
2) I don't use xml, ApplicationResources.properties... files and write
my application as hard-coded.(very bad. I want to use design patterns)
3) I use native2ascii tool and convert my files to utf-8.(I don't know
if it works for JSTL but for struts it is an impractical solution)
4) I don't use JSTL, struts and only servlets and jsp.( then, why
these exist if they can't handle even a simple encoding)?
I am developing a web application in Turkish, with java and
encountered some encoding problems.
I think, I have to encode all my pages with utf-8 if I read my
contents from files(XML, ApplicationResources.properties... etc).???
When I used struts; I keep all my labels and messages in
ApplicationResources.properties file but Turkish characters are not
displayed even I used a filter that sets the encoding to ISO-8859-9. I
used the following to read from ApplicationResources.properties:
<bean:message key="link.employee.helloWorld"/>
When I used JSTL to read xml files, again Turkish characters are not
displayed.
I read XML with the following:
<c:import var="xml" url="/conf/menu.xml" />
<xarse var="dom" doc="${xml}" />
.....
<x:forEach var="menu" select="$dom/firma/menu" varStatus="status">
<x: out select="./@id" />
.....
</x:forEach>
......
I tried native2ascii tool with my struts application and problem is
solved. But since this is very tiring.(well, at least not practical
because my application is not an I18N application. only Turkish), I
did not try for JSTL.
So, I have 4 ways:
1) I don't use java (I want to use java)
2) I don't use xml, ApplicationResources.properties... files and write
my application as hard-coded.(very bad. I want to use design patterns)
3) I use native2ascii tool and convert my files to utf-8.(I don't know
if it works for JSTL but for struts it is an impractical solution)
4) I don't use JSTL, struts and only servlets and jsp.( then, why
these exist if they can't handle even a simple encoding)?