diff options
| author | Kenichi Handa | 2003-01-27 01:04:03 +0000 |
|---|---|---|
| committer | Kenichi Handa | 2003-01-27 01:04:03 +0000 |
| commit | 3201ea579bbe3a9bc2f6bf9d6c9b2121f6bbe2b1 (patch) | |
| tree | 7acce5f565b56e19825446a97071c4f7f24f6066 | |
| parent | 231a33160ed418f73dea4f0972e469c8cdd64c13 (diff) | |
| download | emacs-3201ea579bbe3a9bc2f6bf9d6c9b2121f6bbe2b1.tar.gz emacs-3201ea579bbe3a9bc2f6bf9d6c9b2121f6bbe2b1.zip | |
(x_set_name, x_set_title): Add comment about encoding strategy.
| -rw-r--r-- | src/xfns.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/xfns.c b/src/xfns.c index e7f339198c8..9612d1c80ce 100644 --- a/src/xfns.c +++ b/src/xfns.c | |||
| @@ -2517,6 +2517,20 @@ x_set_name (f, name, explicit) | |||
| 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 |
| @@ -2530,6 +2544,7 @@ x_set_name (f, name, explicit) | |||
| 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 |
| @@ -2630,6 +2645,7 @@ x_set_title (f, name, old_name) | |||
| 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); |
| @@ -2642,6 +2658,7 @@ x_set_title (f, name, old_name) | |||
| 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 |