Re: Does anyone know X and utf-8? Help us with ui i18n prob.

>>>>> Timo Korvola <tkorvola gmail com> writes:

    > It seems to me that the problem is with print representations of
    > non- ascii strings.  That would be a pure rep problem, nothing to
    > do with X property handling or even Sawfish.  It is just that
    > print representations don't read back right.  Try to eval a
    > non-ascii string in rep and see how the printed return value
    > looks. Note that princ or format %s of the string works but format
    > %S does not.  Setting print-escape to nil would seem to help, but
    > the string escaping should really be fixed.

    > -- Timo Korvola <URL:>

It is indeed, following is a simple patch to fix the utf-8 related
bug. Note that this patch only keep it compatible with utf-8 charset, I
don't known other charsets' status. I think it is better remove 'Escape
all control codes' (print-escape value) completely.

diff --git a/src/lisp.c b/src/lisp.c
index c04473c..63af9ca 100644
--- a/src/lisp.c
+++ b/src/lisp.c
@@ -2301,7 +2301,7 @@ rep_string_print(repv strm, repv obj)
     while(len-- > 0)
        c = *s++;
-       if(escape_all && (c < 32 || c > 126))
+       if(escape_all && ((c > 0 && c < 32) || c > 126))
            OUT ('\\');
            OUT ('0' + c / 64);

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