Internationalization, or i18n, is the design and development of a product, application or document content that enables easy localization for target audiences that vary in culture, region, or language. Localization refers to the adaptation of a product, application or document content to meet the language, cultural and other requirements of a specific target market (a “locale”).
Adapting application to various languages is for me, as a Java and HTML developer, more than a common task. Usually the solution involves a set of supported locales, which is very often different from the system locale and/or browser configuration. Majority of such cases are covered by the scenario when user chooses particular language settings and the only place where the locale setting can be stored is the HTTP Session.
Support for this behavior is now handled by majority of frameworks; nevertheless there is still one HTML element that you can’t effectively change - the file upload form field.
Read the rest of this entry »
If the J2SE platform has come a long way in internationalization, entering non-ASCII text in the J2EE world isn’t nearly as easy.
To achieve the same result you have to make some changes in your code and in your web server settings.
Firstly, to make sure that the right value in the Content-Type header precedes the text/html content so your browser correctly auto-detects the right encoding, place the following declaration at the beginning of the JSP:
<%@ page contentType="text/html; charset=utf-8" pageEncoding="UTF-8" %> |
Next you have to create a filter that implements the ‘javax.servlet.Filter’ interface so you can have the request parameters encoded with UTF-8:
package com.samaxes.filters;
import javax.servlet.*;
import java.io.IOException;
/**
* Filter called before every action.
*
* @author : samaxes
*/
public class UTF8Filter implements 1.5.0/docs/api/java/util/logging/Filter.html">Filter {
public void init(FilterConfig filterConfig) {
}
public void destroy() {
}
public void doFilter(ServletRequest servletRequest,
ServletResponse servletResponse,
FilterChain filterChain)
throws 1.5.0/docs/api/java/io/IOException.html">IOException, ServletException {
servletRequest.setCharacterEncoding("UTF-8");
filterChain.doFilter(servletRequest, servletResponse);
}
} |
Now, your server reads the URL POST parameters correctly…
But there still is an issue - during a GET operation.
The trouble is that none of the charset information gets sent back to the web server during a GET or POST operation. The server has no way of knowing how to interpret the url-encoded GET parameters, so it assumes ISO-8859-1.
Fortunately the solution to address this is pretty simple, just specify URIEncoding="UTF-8" in your Tomcat’s connector settings within the server.xml file.
Your application shall now handle UTF-8 just fine.
In this article, Bilal Haidar presents the new localization feature provided by .NET framework 2.0. Throughout the article, the new tools provided by Visual Studio 2005 to support localization will be highlighted and used to show you how easy it is to localize your web applications with ASP.NET 2.0.
In this article, Muhammad Mosa will explore the necessary details for working with resources in ASP.NET applications and for creating international ASP.NET applications based on embedded resources and the integrated localization support.