Unicode

A simple yet powerful way to make our API support multiple languages is to enable the API to support Unicode.

Unicode is an encoding standard that support an international character set. It has a unique number for every character across multiple languages including Chinese, Korean, and Arabic and their scripts. The unique number makes almost all characters identifiable and accessible across platforms, programs, and devices.

So, in short, we can simplify our REST API that supports multiple languages by supporting Unicode as part of their headers. The following code depicts this:

@GetMapping(value="/investors/welcome", produces="text/plain;charset=UTF-8") 
  public String responseProducesConditionCharset() {    return " ("Welcome Investor!" in Japanese)"; 
} 

The output for it is as follows:

The preceding diagram shows the code snippet of the (InvestorController.java) accept-encoding charset in the header and the Postman results for the same.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.191.44.23