[Qt-interest] Is Indian regional language suppot available in QT

Oliver.Knoll at comit.ch Oliver.Knoll at comit.ch
Fri Jul 10 12:06:01 CEST 2009


shariff wrote on Friday, July 10, 2009 11:35 AM:

> Dear Friends,
> 
> How can I get Indian Regional Language support in QT-Programming.
> I want to take user input in a text edit widget in a Indian regional
> language (Hindi, Telugu, Tamil etc) font 

As long as this font is available on your system (as TrueType/OpenType font), Qt should be able to pick it up and use it.

> and want to store their
> unicode or IISCI equivalent in my application. How can I do this? Can

Off course a plain QTextEdit widget (or any other widgets) can't guess what kind of language the user speaks (the fact that it displays a certain range of unicode characters doesn't mean that the user really speaks that language!).

For example könnte ich hier einen deutschen Text schreiben, followed by an english text and copy some cyrilic characters: Привет Спокойные люди (which is supposed to mean "Hello Qt folks" - if it translates to something else, blame http://translation2.paralink.com/ ;). And still your mail reader wouldn't know what kind of language I speak (or intended to write in this mail).

In other words, your users would have to e.g. *explicitly* choose from a drop-down combobox what dialect they are going to write in that widget, and this value you store somewhere together with the entered text, in whatever data structure suitable for your application.

But again, as long as you just want to (re-)display that text and as long as the proper fonts are installed, the QTextEdit does not have a problem with that (as long as the *encoding* is set to Unicode, which is the default for QString): merely for *displaying* the text any Qt text widget does *not* need to know what "language" the text is in, as long as it is properly encoded with Unicode and a font which is able to display the respective Unicode range is installed!

You might want to read up here as well:

  http://doc.qtsoftware.com/4.5/qstring.html#details (how QString stores characters)

Pay special attention to the chapter "Converting Between 8-Bit Strings and Unicode Strings" and such, in case you are reading/writing from/to an external data source.

Maybe this could also be of any help: http://doc.qtsoftware.com/4.5/i18n.html
specifically: http://doc.qtsoftware.com/4.5/i18n.html#support-for-encodings


Cheers, Oliver
-- 
Oliver Knoll
Dipl. Informatik-Ing. ETH
COMIT AG - ++41 79 520 95 22




More information about the Qt-interest-old mailing list