# centericq and utf8

## Kjir

Hi all,

as you probably know centericq does not have utf-8 support in it, so if you switch your gentoo to utf-8 you can't see any letter outside the iso8859-1 encoding. What a pity!

What I find most disturbing is that in Debian there is a package called centericq-utf8 with all the patches needed to get utf8 support, but that's just Debian and nobody else... That doesn't sound too much in the spirit of open source!

I'm trying to see if it is possible to update the centericq ebuild with those patches, but it looks like it will be harder that what I expected: Debian patches are applied through the dpatch utility which, AFAIK, is not available under Gentoo.

I thought a little bit about it and the best solution I can think of is to apply those debian patches (with a Debian I will install under qemu), try to compile those modified sources under Gentoo, try and see if the package still works and - if it does - create and put online a "normal" patch for utf-8 (and some other stuff the guys at Debian did).

After some initial tests I will consider the option of creating a completely different ebuild for centericq-utf8 (I read somewhere - can't remember where exactly - that it is more like a completely different package) or simply adding an unicode USE flag with the patch, I would gladly hear what you think about this.

So, now, is there anybody out there who would like to help me? I will need help especially if I find out that the Debian patches break somehow the packages (for instance if some shared library is changed) because that will mean source code diving.

I would really appreciate to know what you think about this, if you know something more about it, or any other kind of help.

StÃ©phane

----------

## curtis119

You may want to check out the epatch section of the Gentoo Development Guide.

----------

## Kjir

I knew about epatch, but a very useful Guide anyways, thank you.

I wrote to the Debian mantainer and he told me that these are patches which simply recompiles centericq with libncursesw5, so it is not a full utf-8 support, but it is for sure an improvement anyways.

----------

## curtis119

 *Kjir wrote:*   

> I knew about epatch, but a very useful Guide anyways, thank you.
> 
> I wrote to the Debian mantainer and he told me that these are patches which simply recompiles centericq with libncursesw5, so it is not a full utf-8 support, but it is for sure an improvement anyways.

 

Excellent, I'm glad you figured it out. Debian Maintainer++

----------

## Kjir

Great, I could finally see some accented characters with UTF-8!!

The suggestion by Julien Lemoine was definetely good, so linking centericq against ncursesw gives a quick workaround that somehow works, even if not flawlessly.

The problem now is that when you type an accented character, it also add an extra space, so there's some work to be done for this to work decently. But at leat it is possible to display accents!

Hacking around with the Debian sources, I noticed some other patches that might be useful, I think I will start with these and update the existing ebuild to support these improvements.

Soon I will inform you of updates and send some stuff!   :Very Happy: 

----------

## Kjir

Ok, here is an updated ebuild for centericq and a patch for fake unicode support. You can download them from

http://www.sbisinger.net/gentoo/centericq-4.21.0-r3.ebuild

http://www.sbisinger.net/gentoo/centericq-4.21.0-utf8.diff

The added features are:

 Added unicode USE flag for displaying wide-characters

 Added gg USE flag to switch on/off GaduGadu support

I will add some other things, so for now I won't submit it to bugzilla, yet you can try it out and see if it works.

----------

## truc

I'm interested in this, will try as soon as I can, but what's exactly GaduGadu??.

----------

## Syntaxis

 *truc wrote:*   

> what's exactly GaduGadu??.

 

A Polish instant messaging program. Clicky-clicky.  :Smile: 

----------

## Kjir

Ok, added a couple of patches, one that modifies the text tip from "esc" to the correct value "esc-esc" and one that should fix some possible jabber segfaults.

Here are the updated ebuild and patches:

http://www.sbisinger.net/gentoo/centericq-4.21.0-r3.ebuild

http://www.sbisinger.net/gentoo/centericq-4.21.0-utf8.diff

http://www.sbisinger.net/gentoo/centericq-4.21.0-msg_esc.diff

http://www.sbisinger.net/gentoo/centericq-4.21.0-jabber_segv.diff

Please try them out and report any problems. I am submitting them to bugzilla too.

----------

## nixnut

Moved from Gentoo Chat to Networking & Security.

Networking stuff, so moved here.

----------

## consume.noise

1. It doesn't work.

2. What I tried:

- the patch above

- the patch from [1]

  (both patches do what they should, i.e. ldd lists libncursesw)

- various combinations of LC_ALL and LANG with UTF-8 and utf8, as written in [2]

3. What I want:

- those crappy german umlauts to be displayed

4. the environment:

- xterm with and w/o screen

- normally only LC_CTYPE is set to en_US.utf8

- working apps, i.e.: vim, zsh (4.3.2)

5. we are getting familiar:

Changing LC_* and/or LANG obviously changes nothing and it looks like the patches do the half thing:

a) The borders of the contact list are okay, so the name width of each contact seems to be calculated correctly.

    But, every umlaut in there shows up as a rectangle (*).

b) (with screen) While writing a message I get 2 rectangles (*) for every umlaut. This might mean,

    the (multibyte) character is not detected correctly and therefor the calculated width is wrong.

c) (plain xterm) While writing a message I get a combination of a rectangle (*), a squared bracket open, a m and

    another rectangle (*). Maybe, the bracket and the m should be an escape sequence.

6. your turn

Do you have any ideas what I may additionally should test or write here?

I would thank you for any advice, that might help to track down this damn bug. And as my friend google told me,

you would help a lot of people out there.

greetings, Daniel

(*) I know that a rectangle might mean, the characterset doesn't have a correct symbol for it. But, at the prompt

I'm able to type those umlauts and they show up correctly. So, I think the internal translation (in centericq) is

wrong.

[1] http://xpisar.wz.cz/centericq/

[2] https://forums.gentoo.org/viewtopic-t-356240.html

----------

## Kjir

[/code] *consume.noise wrote:*   

> 
> 
> 3. What I want:
> 
> - those crappy german umlauts to be displayed
> ...

 

I can display them, my setting for LC_CTYPE is en_US.UTF-8 . This should be equal to the value you have in /etc/locales.build , case and everything.

 *consume.noise wrote:*   

> 
> 
> 5. we are getting familiar:
> 
> Changing LC_* and/or LANG obviously changes nothing and it looks like the patches do the half thing:
> ...

 

Are you sure that utf-8 is correctly installed? Is it the same output you get without the patches?

 *consume.noise wrote:*   

> 
> 
> 6. your turn
> 
> Do you have any ideas what I may additionally should test or write here?
> ...

 

Sadly this is actually not a bug. This patch is just an hack that it is not supposed to work well, but in some (hopefully most) cases it should display characters correctly. The thing is that the code is absolutely not capable to handle wide-characters, so there are plenty of issues out there ready to harass you. Actually I am working precisely on this issue, I am rewriting part of the code to make centericq capable of handling utf-8 and wide-characters; it will take some time, but hopefully this will solve all these issues and help a lot of people out there. By the way, if anyone is willing to join me on this effort, I would be greatly thankful.

----------

## consume.noise

I've found a problem. The contact list didn't showed up correctly, because the local contact informations were

saved iso encoded. (Thanks to hexdump, which told me so.)

In centericq I had to set the local encoding to UTF-8, delete the contact list and go online again. Except of a ß,

everything looks okay for the moment.

In my locale.gen, I've "en_US.UTF-8 UTF-8". So, I tried LC_CTYPE, LC_ALL and LANG with "en_US.UTF-8", again

(and combinations of those variables). But, the "double rectangle" problem while writing messages still occurs.

----------

## danja

sorry for bringing up the old crap, but i'm getting next when trying to emerge patched ebuild:

```
~# c610 ~ # ACCEPT_KEYWORDS="~x86" USE="unicode" emerge ">net-im/centericq-4.21.0-r2" -v

[...cut...]

config.status: creating Makefile

config.status: WARNING:  Makefile.in seems to ignore the --datarootdir setting

cd . && aclocal-1.4

aclocal: configure.in: 88: macro `AM_PATH_LIBGNUTLS_EXTRA' not found in library

aclocal: macro `AM_PROG_MKDIR_P' required but not defined

aclocal: macro `AM_PROG_MKDIR_P' required but not defined

make: *** [aclocal.m4] Error 1

!!! ERROR: net-im/centericq-4.21.0-r3 failed.

Call stack:

  ebuild.sh, line 1568:   Called dyn_compile

  ebuild.sh, line 937:   Called src_compile

  centericq-4.21.0-r3.ebuild, line 86:   Called die

!!! Compilation failed

```

i went up through the output - nothing suspecious, only "WARNING:  Makefile.in seems to ignore the --datarootdir setting" warnings.

if i USE="-unicode" the error doesn't appear but then the whole trouble is pointless.

any clue?

----------

