Monday, September 2, 2013

Printing Unicode characters from eclipse (example to print kannada letters)

Do you want to print your name in your native language (other than English) ?
You need to find the equivalent Unicode characters and change the eclipse settings to display UTF-8 encoding.

Problem statement: 
    Print my name Siddesh in Kannada

Solution:
  Step 1: Find Unicode characters.        
             Refer http://symbolcodes.tlt.psu.edu/bylanguage/kannadachart.html
             Here
              Sa = 0CB8 
             To make it Si = Sa + 0CBF i.e "\u0CB8\u0CBF"
  Step 2: Change eclipse settings
             Window -> Preferences -> General -> Workspace -> Text file encoding -> Other -> Choose UTF-8 from drop down

Program:

public class Kannada {
public static void main(String[] args) {
System.out.println("Hello \u0CB8\u0CBF \u0CA6\u0CC7 \u0CB6\u0CCD");
System.out.println("");

}

}
           
Output:
Hello ಸಿದ್ದೇಶ್            



No comments:

Post a Comment