Developing Java Applications with Unicode Data

Author: Shazin Sadakath

Recently we got to work with a Japanese client and had to develop the backend and REST API to work with Japanese Characters. Following are some of the lessons we learnt during that Software Development work.

Infrastructure timezone must be changed

Since we were using AWS IaaS (AWS Linux) we followed the instruction available at AWS Documentation to change the timezone. So please following your Infrastructure documentation to set up the timezone.

Database must be created with Unicode support and Timezone must be properly set

Creating MySQL Database with UTF8 Encoding


This is important as data will be stored eventually on the database. So please check your Database Server manual on how to create a Database with UTF8 Encoding.

Changing MySQL Database Server timezone

Changing the configuration file for MySQL and adding following;

default-time-zone = '+09:00'

The setting is from + or - no of hours from GMT time. So please check your Database Server manual on how to set the timezone. After which Database server must be restarted.

Connecting to Database with Unicode support

Setting JDBC MySQL Connection URL Query Strings


In MySQL we used useUnicode, characterEncoding, useTimezone, serverTimezone to create a JDBC Connection which uses Unicode encoding and Japanese Timezone. So please your JDBC Driver based on Database server to configure the connection if required.

JSON Serialization using Jackson with Timezone

Setting up JSON ObjectMapper to use the system default timezone

Following Jackson2ObjectMapperBuilderCustomizer must be configured to set the timezone.

    public Jackson2ObjectMapperBuilderCustomizer jacksonObjectMapperCustomization() {
        return jacksonObjectMapperBuilder ->


Finally testing is required make sure everything works well together.

Tags: Unicode UTF8 Java MySQL Japanese
Views: 1461
Register for more exciting articles


Please login or register to post a comment.

There are currently no comments.