Java and UTF-8
Generally we can rely on Java as long as source strings are properly encoded. Please refer link:
Generally we can rely on Java as long as source strings are properly encoded. Please refer link:
- http://java.sun.com/docs/books/tutorial/i18n/text/convertintro.html,
- http://java.sun.com/javase/technologies/core/basic/intl/faq.jsp
- JSP pages must include the header: <%@ page contentType="text/html; charset=UTF-8"%>
- Update the file $CATALINA_HOME/conf/server.xml : add attribute URIEncoding="UTF-8" in Connector tag
- Add filter as suggested in the link : http://wiki.apache.org/tomcat/Tomcat/UTF-8
- Tomcat UTF-8 Problem with request.getParameter(), http://answers.google.com/answers/threadview?id=580467
- useBodyEncodingForURI : http://tomcat.apache.org/tomcat-5.5-doc/config/ajp.html
- We need our databases and tables to be in utf8 character set : ALTER tables with an SQL statement like - ALTER DATABASE db_name CHARACTER SET utf8 COLLATE utf8_general_ci;
- Start mysql-demon using option "--character-set-server=utf8" : mysqld ócharacter-set-server=utf8
- May be useful : http://lists.mysql.com/java/8081
- We can also use useUnicode and characterEncoding properties to configure the JDBC driver to use UTF-8.
- http://dev.mysql.com/doc/refman/5.0/en/connector-j-reference-charsets.html
- As suggested in the link we can use utf8 encoding either by configuring utf8 as the default server character set in MySql?, or by configuring the JDBC driver to use UTF-8 through the characterEncoding property
- Add encoding="UTF-8" in (JR)XML header.
Comments