comparison src/xfns.c @ 49473:5579114f7b97

(x_set_name, x_set_title): Add comment about encoding strategy.
author Kenichi Handa <handa@m17n.org>
date Mon, 27 Jan 2003 01:04:03 +0000
parents a4d0ee33dcce
children 23a1cea22d13
comparison
equal deleted inserted replaced
49472:3fd3c5521557 49473:5579114f7b97
2515 { 2515 {
2516 XTextProperty text, icon; 2516 XTextProperty text, icon;
2517 int bytes, stringp; 2517 int bytes, stringp;
2518 Lisp_Object coding_system; 2518 Lisp_Object coding_system;
2519 2519
2520 /* Note: Encoding strategy
2521
2522 We encode NAME by compound-text and use "COMPOUND-TEXT" in
2523 text.encoding. But, there are non-internationalized window
2524 managers which don't support that encoding. So, if NAME
2525 contains only ASCII and 8859-1 characters, encode it by
2526 iso-latin-1, and use "STRING" in text.encoding hoping that
2527 such window manager at least analize this format correctly,
2528 i.e. treat 8-bit bytes as 8859-1 characters.
2529
2530 We may also be able to use "UTF8_STRING" in text.encoding
2531 in the feature which can encode all Unicode characters.
2532 But, for the moment, there's no way to know that the
2533 current window manager supports it or not. */
2520 coding_system = Qcompound_text; 2534 coding_system = Qcompound_text;
2521 text.value = x_encode_text (name, coding_system, 0, &bytes, &stringp); 2535 text.value = x_encode_text (name, coding_system, 0, &bytes, &stringp);
2522 text.encoding = (stringp ? XA_STRING 2536 text.encoding = (stringp ? XA_STRING
2523 : FRAME_X_DISPLAY_INFO (f)->Xatom_COMPOUND_TEXT); 2537 : FRAME_X_DISPLAY_INFO (f)->Xatom_COMPOUND_TEXT);
2524 text.format = 8; 2538 text.format = 8;
2528 { 2542 {
2529 icon = text; 2543 icon = text;
2530 } 2544 }
2531 else 2545 else
2532 { 2546 {
2547 /* See the above comment "Note: Encoding strategy". */
2533 icon.value = x_encode_text (f->icon_name, coding_system, 0, 2548 icon.value = x_encode_text (f->icon_name, coding_system, 0,
2534 &bytes, &stringp); 2549 &bytes, &stringp);
2535 icon.encoding = (stringp ? XA_STRING 2550 icon.encoding = (stringp ? XA_STRING
2536 : FRAME_X_DISPLAY_INFO (f)->Xatom_COMPOUND_TEXT); 2551 : FRAME_X_DISPLAY_INFO (f)->Xatom_COMPOUND_TEXT);
2537 icon.format = 8; 2552 icon.format = 8;
2628 XTextProperty text, icon; 2643 XTextProperty text, icon;
2629 int bytes, stringp; 2644 int bytes, stringp;
2630 Lisp_Object coding_system; 2645 Lisp_Object coding_system;
2631 2646
2632 coding_system = Qcompound_text; 2647 coding_system = Qcompound_text;
2648 /* See the comment "Note: Encoding strategy" in x_set_name. */
2633 text.value = x_encode_text (name, coding_system, 0, &bytes, &stringp); 2649 text.value = x_encode_text (name, coding_system, 0, &bytes, &stringp);
2634 text.encoding = (stringp ? XA_STRING 2650 text.encoding = (stringp ? XA_STRING
2635 : FRAME_X_DISPLAY_INFO (f)->Xatom_COMPOUND_TEXT); 2651 : FRAME_X_DISPLAY_INFO (f)->Xatom_COMPOUND_TEXT);
2636 text.format = 8; 2652 text.format = 8;
2637 text.nitems = bytes; 2653 text.nitems = bytes;
2640 { 2656 {
2641 icon = text; 2657 icon = text;
2642 } 2658 }
2643 else 2659 else
2644 { 2660 {
2661 /* See the comment "Note: Encoding strategy" in x_set_name. */
2645 icon.value = x_encode_text (f->icon_name, coding_system, 0, 2662 icon.value = x_encode_text (f->icon_name, coding_system, 0,
2646 &bytes, &stringp); 2663 &bytes, &stringp);
2647 icon.encoding = (stringp ? XA_STRING 2664 icon.encoding = (stringp ? XA_STRING
2648 : FRAME_X_DISPLAY_INFO (f)->Xatom_COMPOUND_TEXT); 2665 : FRAME_X_DISPLAY_INFO (f)->Xatom_COMPOUND_TEXT);
2649 icon.format = 8; 2666 icon.format = 8;