Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unicode support for android

I am new in android. I want to know does android support Unicode. If yes, then how can we use it through java code. I have written a program

TextView tv = new TextView(this);
tv.setText("Hello, চন্দন");
setContentView(tv);

The Bengali unicode characters are coming as boxes.

Thanks in advance.

like image 990
Chandan Avatar asked Mar 14 '11 15:03

Chandan


People also ask

What is Unicode in Android phone?

Android UnicodeMap lets you browse Unicode characters by range and search for them by name, display them (when Android has the font) and copy them to the clipboard. It can also decode a string of Unicode characters to names.

What is Unicode text?

Unicode is an international character encoding standard that provides a unique number for every character across languages and scripts, making almost all characters accessible across platforms, programs, and devices.

Can I update Unicode?

A: You cannot update Unicode on Android.

How do I use Unicode characters in XML?

Characters are denoted using the notation used in the Unicode Standard, that is, an optional U+ followed by their hexadecimal number, using at least 4 digits, such as "U+1234" or "U+10FFFD". In XML or HTML this could be expressed as "ሴ" or "􏿽".


2 Answers

"Supporting Unicode" - which is simply a character encoding standard - and displaying Unicode text in a way that can be read properly are whole different things.

The latter requires both a proper font for the script concerned and a complex text rendering engine which applies rules embedded in the font to display text properly. In Windows this is handled by system library called Uniscribe, on Apple systems by ATSUI, and on Linux systems by Pango. Android is based on Linux but unfortunately Google seem to have removed the parts for handling complex scripts. (A rather strange decision since most Android devices are for communications including text.) Complex scripts work fine on other mobile devices using a Linux based operating system like the Nokia N9 and N900

Android also makes it difficult for users to install additional fonts or keyboard layouts that can be used by different applications without "rooting" their phone or tablet.

A few manufacturers of Android devices have implemented support on their own (e.g. Sony Ericsson's ST and MT series phones seem to support Devanagari and other Indic scipts very well.) On some Android phones Indic scripts will render OK in the browser - because the browser developer has added support of their own - but will not work in other applications.

Please see: http://code.google.com/p/android/issues/detail?id=4153

Until this issue is properly fixed in Android, most devices running this operating system seem to be a poor choice for users who want to use scripts like Devanagari, Tamil, Bengali, Kannada, Punjabi, Telugu, Tibetan, Khmer, Sinhala, Malayalam, Burmese, and so on on their smart phone or tablet.

The part of Android that needs fixing to support complex scripts is libskia.so and libwebcore.so. So, if you are writing applications to support Indian languages, you might want to try replacing these libraries with your own modified versions.

like image 175
Sahaja Avatar answered Sep 30 '22 05:09

Sahaja


Android does support Unicode, but the fonts included don't cover all Unicode characters, and the rendering doesn't support all types of scripts. In particular, the included fonts only cover Western European (Latin), Cyrillic, Greek, and CJK characters. Even if you install new fonts, it appears that Android does not properly support some forms of indic text layout like Devanagari, as mentioned in bug 4153. I'm not familiar enough with the Bengali script to know if it requires any sort of special rendering like Devanagari does, but if it does, then it is likely not supported on Android even if you install a font that supports it.

like image 28
Brian Campbell Avatar answered Sep 30 '22 07:09

Brian Campbell