LCDproc development and user support list

Text archives Help

[Lcdproc] UTF8 support

Chronological Thread 
  • From: brabant AT (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=
a conversion function ConvertUTF8toUTF32 from It works and I c=
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=
string length because it only expects single-byte characters. The scroller =
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=
thought about it before coding everything !

The solution would be to change the data type of the widget's text (w->text=
to int and do the UTF8 -> UTF32 conversion inside LCDProc's functions inste=
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=
how widespread the reference to the char data type for the text is and how=
much changes are required. This would be worth it tho, LCDProc would have=20
full UTF8 support.

Any opinions ?


Archive powered by MHonArc 2.6.18.

Top of page