ratpoison-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [RP] [PATCH] if compiling with xft, hardcode encoding to utf-8


From: Jérémie Courrèges -Anglas
Subject: Re: [RP] [PATCH] if compiling with xft, hardcode encoding to utf-8
Date: Mon, 02 Jul 2012 17:48:16 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.1.50 (berkeley-unix)

Hi.

"Bernhard R. Link" <address@hidden> writes:

> * Jérémie Courrèges-Anglas <address@hidden> [120630 18:39]:
>> > Unlike the X primitives, Xft does not seem to support
>> > utf-8 when drawing a string encoded according to the current
>> > locale. So if compiling with Xft, hardcode the encoding to be
>> > used to utf-8.
>>
>> This has the undesirable effect to break existing setups.  People using
>> for example latin1 wouldn't be able to input and echo latin1 characters.
>> I'm no unicode expert, but if ratpoison has to get unicode support, then
>> it should probably do it correctly, right?
>
> without Xft fonts, UTF-8 works correctly. With Xft one has to use a
> single-character encoding or use utf8. do you know any way to know in
> which case libX11 currently is so one can call the correct Xft function?

My strategy would be to detect whether we're using an UTF-8 locale, and
then act accordingly.  But it seems this would only be useful when using
Xft, so, make that detection present only when using Xft.

I've made the use of Xutf8* conditional, since I don't know what's the
current state of this extension.  If Xutf8* aren't available, just
revert to Xmb*.  Has it (that stuff seems to be related to UTF8_STRING)
really been included in the X standard?  If so, how portable is it?

I have not yet found out how much we should bother about with the getsel
code.  Also the input editing should be modified to deal with multibytes
characters.

Honestly, I have no idea whether this is the cleanest way to do it
(while keeping it simple).  Please test the attached patch, whether you
use ISO8859-1 or UTF-8 or anything else. :)

Regards.

PS: I've dropped the AC_TYPE_SIGNAL macro call since RETSIGTYPE wasn't
used anywhere in the code and we assume ANSI C anyway.

Attachment: xft-utf8.diff
Description: Text Data

-- 
Jérémie Courrèges-Anglas
GPG fingerprint: 61DB D9A0 00A4 67CF 2A90 8961 6191 8FBF 06A1 1494

Attachment: pgpVMgKx9lnyH.pgp
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]