LCDproc development and user support list

Text archives Help


[Lcdproc] UTF8 support


Chronological Thread 
  • From: brabant AT magma.ca (Mathieu Brabant)
  • Subject: [Lcdproc] UTF8 support
  • Date: Sun Apr 27 08:09:02 2008

Hi all.

I have managed to add UTF support to the iMON LCD driver (imonlcd.c), by us=
ing=20
a conversion function ConvertUTF8toUTF32 from Unicode.org. It works and I c=
an=20
get accented characters by adding a line like this to the font definition:

{ 0x00E0, { 0x0, 0x4, 0x2A, 0xAA, 0x6A, 0x1E } }, // =E0

All was good.

Except that LCDProc's render function (ie: render_frame) gets confused abou=
t=20
string length because it only expects single-byte characters. The scroller =
is=20
not happy, it counts every multi-byte UTF8 characters as being multiple=20
characters instead of one.... This is kind of obvious but I wish I would ha=
ve=20
thought about it before coding everything !

The solution would be to change the data type of the widget's text (w->text=
)=20
to int and do the UTF8 -> UTF32 conversion inside LCDProc's functions inste=
ad=20
of the driver. This might be alot of work, memcpy would have to be used=20
instead of strncpy and I haven't looked at the whole source of LCDProc to s=
ee=20
how widespread the reference to the char data type for the text is and how=
=20
much changes are required. This would be worth it tho, LCDProc would have=20
full UTF8 support.

Any opinions ?

Mathieu




Archive powered by MHonArc 2.6.18.

Top of page