]> code.delx.au - gnu-emacs/blobdiff - lisp/term/x-win.el
*** empty log message ***
[gnu-emacs] / lisp / term / x-win.el
index a7d47926e8eebc230de0786aeb3e5942236281f4..12991037a6039899f08e82eb012f4447f924676d 100644 (file)
@@ -1,4 +1,4 @@
-;;; x-win.el --- parse relevant switches and set up for X  -*-coding: utf-8-emacs;-*-
+;;; x-win.el --- parse relevant switches and set up for X  -*-coding: iso-2022-7bit;-*-
 
 ;; Copyright (C) 1993, 1994, 2001, 2002 Free Software Foundation, Inc.
 
@@ -68,7 +68,7 @@
 
 (if (not (eq window-system 'x))
     (error "%s: Loading x-win.el but not compiled for X" (invocation-name)))
-        
+
 (require 'frame)
 (require 'mouse)
 (require 'scroll-bar)
@@ -233,6 +233,75 @@ This function returns ARGS minus the arguments that have been processed."
            (funcall handler this-switch))
        (setq args (cons orig-this-switch args)))))
   (nconc (nreverse args) x-invocation-args))
+
+;; Handle the --smid switch.  This is used by the session manager
+;; to give us back our session id we had on the previous run.
+(defun x-handle-smid (switch)
+  (or (consp x-invocation-args)
+      (error "%s: missing argument to `%s' option" (invocation-name) switch))
+  (setq x-session-previous-id (car x-invocation-args)
+       x-invocation-args (cdr x-invocation-args)))
+
+(defvar emacs-save-session-functions nil
+  "Special hook run when a save-session event occurs.
+The functions do not get any argument.
+Functions can return non-nil to inform the session manager that the
+window system shutdown should be aborted.
+
+See also `emacs-session-save'.")
+
+(defun emacs-session-filename (session-id)
+  "Construct a filename to save the session in based on SESSION-ID.
+If the directory ~/.emacs.d exists, we make a filename in there, otherwise
+a file in the home directory."
+  (let ((basename (concat "session." session-id))
+       (emacs-dir "~/.emacs.d/"))
+    (expand-file-name (if (file-directory-p emacs-dir)
+                         (concat emacs-dir basename)
+                       (concat "~/.emacs-" basename)))))
+
+(defun emacs-session-save ()
+  "This function is called when the window system is shutting down.
+If this function returns non-nil, the window system shutdown is cancelled.
+
+When a session manager tells Emacs that the window system is shutting
+down, this function is called.  It calls the functions in the hook
+`emacs-save-session-functions'.  Functions are called with the current
+buffer set to a temporary buffer.  Functions should use `insert' to insert
+lisp code to save the session state.  The buffer is saved
+in a file in the home directory of the user running Emacs.  The file
+is evaluated when Emacs is restarted by the session manager.
+
+If any of the functions returns non-nil, no more functions are called
+and this function returns non-nil.  This will inform the session manager
+that it should abort the window system shutdown."
+  (let ((filename (emacs-session-filename x-session-id))
+       (buf (get-buffer-create (concat " *SES " x-session-id))))
+    (when (file-exists-p filename)
+      (delete-file filename))
+    (with-current-buffer buf
+      (let ((cancel-shutdown (condition-case nil
+                                ;; A return of t means cancel the shutdown.
+                                (run-hook-with-args-until-success
+                                 'emacs-save-session-functions)
+                              (error t))))
+       (unless cancel-shutdown
+         (write-file filename))
+       (kill-buffer buf)
+       cancel-shutdown))))
+
+(defun emacs-session-restore (previous-session-id)
+  "Restore the Emacs session if started by a session manager.
+The file saved by `emacs-session-save' is evaluated and deleted if it
+exists."
+  (let ((filename (emacs-session-filename previous-session-id)))
+    (when (file-exists-p filename)
+      (load-file filename)
+      (delete-file filename)
+      (message "Restored session data"))))
+
+
+
 \f
 ;;
 ;; Standard X cursor shapes, courtesy of Mr. Fox, who wanted ALL of them.
@@ -1090,13 +1159,6 @@ XConsortium: rgb.txt,v 10.41 94/02/20 18:39:36 rws Exp")
 \f
 ;;;; Function keys
 
-(defun iconify-or-deiconify-frame ()
-  "Iconify the selected frame, or deiconify if it's currently an icon."
-  (interactive)
-  (if (eq (cdr (assq 'visibility (frame-parameters))) t)
-      (iconify-frame)
-    (make-frame-visible)))
-
 (substitute-key-definition 'suspend-emacs 'iconify-or-deiconify-frame
                           global-map)
 
@@ -1117,6 +1179,7 @@ XConsortium: rgb.txt,v 10.41 94/02/20 18:39:36 rws Exp")
 (define-key function-key-map [M-return] [?\M-\C-m])
 (define-key function-key-map [M-escape] [?\M-\e])
 (define-key function-key-map [iso-lefttab] [backtab])
+(define-key function-key-map [S-iso-lefttab] [backtab])
 
 ;; These tell read-char how to convert
 ;; these special chars to ASCII.
@@ -1132,9 +1195,10 @@ XConsortium: rgb.txt,v 10.41 94/02/20 18:39:36 rws Exp")
 ;;;; Keysyms
 
 (defun vendor-specific-keysyms (vendor)
-  "Return the appropriate value of system-key-alist for VENDOR.
+  "Return the appropriate value of `system-key-alist' for VENDOR.
 VENDOR is a string containing the name of the X Server's vendor,
-as returned by (x-server-vendor)."
+as returned by `x-server-vendor'."
+  ;; Fixme: Drop Apollo now?
   (cond ((string-equal vendor "Apollo Computer Inc.")
         '((65280 . linedel)
           (65281 . chardel)
@@ -1178,6 +1242,7 @@ as returned by (x-server-vendor)."
           (65395 . deletechar)
           (65396 . backtab)
           (65397 . kp-backtab)))
+       ;; Fixme: What about non-X11/NeWS sun server?
        ((or (string-equal vendor "X11/NeWS - Sun Microsystems Inc.")
             (string-equal vendor "X Consortium"))
         '((392976 . f36)
@@ -1204,774 +1269,797 @@ as returned by (x-server-vendor)."
 ;; appendix to the X protocol definition.
 (dolist
      (pair
-      '((#x1a1 . ?Ą)
-       (#x1a2 . ?˘)
-       (#x1a3 . ?Ł)
-       (#x1a5 . ?Ľ)
-       (#x1a6 . ?Ś)
-       (#x1a9 . ?Š)
-       (#x1aa . ?Ş)
-       (#x1ab . ?Ť)
-       (#x1ac . ?Ź)
-       (#x1ae . ?Ž)
-       (#x1af . ?Ż)
-       (#x1b1 . ?ą)
-       (#x1b2 . ?˛)
-       (#x1b3 . ?ł)
-       (#x1b5 . ?ľ)
-       (#x1b6 . ?ś)
-       (#x1b7 . ?ˇ)
-       (#x1b9 . ?š)
-       (#x1ba . ?ş)
-       (#x1bb . ?ť)
-       (#x1bc . ?ź)
-       (#x1bd . ?˝)
-       (#x1be . ?ž)
-       (#x1bf . ?ż)
-       (#x1c0 . ?Ŕ)
-       (#x1c3 . ?Ă)
-       (#x1c5 . ?Ĺ)
-       (#x1c6 . ?Ć)
-       (#x1c8 . ?Č)
-       (#x1ca . ?Ę)
-       (#x1cc . ?Ě)
-       (#x1cf . ?Ď)
-       (#x1d0 . ?Đ)
-       (#x1d1 . ?Ń)
-       (#x1d2 . ?Ň)
-       (#x1d5 . ?Ő)
-       (#x1d8 . ?Ř)
-       (#x1d9 . ?Ů)
-       (#x1db . ?Ű)
-       (#x1de . ?Ţ)
-       (#x1e0 . ?ŕ)
-       (#x1e3 . ?ă)
-       (#x1e5 . ?ĺ)
-       (#x1e6 . ?ć)
-       (#x1e8 . ?č)
-       (#x1ea . ?ę)
-       (#x1ec . ?ě)
-       (#x1ef . ?ď)
-       (#x1f0 . ?đ)
-       (#x1f1 . ?ń)
-       (#x1f2 . ?ň)
-       (#x1f5 . ?ő)
-       (#x1f8 . ?ř)
-       (#x1f9 . ?ů)
-       (#x1fb . ?ű)
-       (#x1fe . ?ţ)
-       (#x1ff . ?˙)
-       (#x2a1 . ?Ħ)
-       (#x2a6 . ?Ĥ)
-       (#x2a9 . ?İ)
-       (#x2ab . ?Ğ)
-       (#x2ac . ?Ĵ)
-       (#x2b1 . ?ħ)
-       (#x2b6 . ?ĥ)
-       (#x2b9 . ?ı)
-       (#x2bb . ?ğ)
-       (#x2bc . ?ĵ)
-       (#x2c5 . ?Ċ)
-       (#x2c6 . ?Ĉ)
-       (#x2d5 . ?Ġ)
-       (#x2d8 . ?Ĝ)
-       (#x2dd . ?Ŭ)
-       (#x2de . ?Ŝ)
-       (#x2e5 . ?ċ)
-       (#x2e6 . ?ĉ)
-       (#x2f5 . ?ġ)
-       (#x2f8 . ?ĝ)
-       (#x2fd . ?ŭ)
-       (#x2fe . ?ŝ)
-       (#x3a2 . ?ĸ)
-       (#x3a3 . ?Ŗ)
-       (#x3a5 . ?Ĩ)
-       (#x3a6 . ?Ļ)
-       (#x3aa . ?Ē)
-       (#x3ab . ?Ģ)
-       (#x3ac . ?Ŧ)
-       (#x3b3 . ?ŗ)
-       (#x3b5 . ?ĩ)
-       (#x3b6 . ?ļ)
-       (#x3ba . ?ē)
-       (#x3bb . ?ģ)
-       (#x3bc . ?ŧ)
-       (#x3bd . ?Ŋ)
-       (#x3bf . ?ŋ)
-       (#x3c0 . ?Ā)
-       (#x3c7 . ?Į)
-       (#x3cc . ?Ė)
-       (#x3cf . ?Ī)
-       (#x3d1 . ?Ņ)
-       (#x3d2 . ?Ō)
-       (#x3d3 . ?Ķ)
-       (#x3d9 . ?Ų)
-       (#x3dd . ?Ũ)
-       (#x3de . ?Ū)
-       (#x3e0 . ?ā)
-       (#x3e7 . ?į)
-       (#x3ec . ?ė)
-       (#x3ef . ?ī)
-       (#x3f1 . ?ņ)
-       (#x3f2 . ?ō)
-       (#x3f3 . ?ķ)
-       (#x3f9 . ?ų)
-       (#x3fd . ?ũ)
-       (#x3fe . ?ū)
-       (#x47e . ?‾)
-       (#x4a1 . ?。)
-       (#x4a2 . ?\「)
-       (#x4a3 . ?\」)
-       (#x4a4 . ?、)
-       (#x4a5 . ?・)
-       (#x4a6 . ?ヲ)
-       (#x4a7 . ?ァ)
-       (#x4a8 . ?ィ)
-       (#x4a9 . ?ゥ)
-       (#x4aa . ?ェ)
-       (#x4ab . ?ォ)
-       (#x4ac . ?ャ)
-       (#x4ad . ?ュ)
-       (#x4ae . ?ョ)
-       (#x4af . ?ッ)
-       (#x4b0 . ?ー)
-       (#x4b1 . ?ア)
-       (#x4b2 . ?イ)
-       (#x4b3 . ?ウ)
-       (#x4b4 . ?エ)
-       (#x4b5 . ?オ)
-       (#x4b6 . ?カ)
-       (#x4b7 . ?キ)
-       (#x4b8 . ?ク)
-       (#x4b9 . ?ケ)
-       (#x4ba . ?コ)
-       (#x4bb . ?サ)
-       (#x4bc . ?シ)
-       (#x4bd . ?ス)
-       (#x4be . ?セ)
-       (#x4bf . ?ソ)
-       (#x4c0 . ?タ)
-       (#x4c1 . ?チ)
-       (#x4c2 . ?ツ)
-       (#x4c3 . ?テ)
-       (#x4c4 . ?ト)
-       (#x4c5 . ?ナ)
-       (#x4c6 . ?ニ)
-       (#x4c7 . ?ヌ)
-       (#x4c8 . ?ネ)
-       (#x4c9 . ?ノ)
-       (#x4ca . ?ハ)
-       (#x4cb . ?ヒ)
-       (#x4cc . ?フ)
-       (#x4cd . ?ヘ)
-       (#x4ce . ?ホ)
-       (#x4cf . ?マ)
-       (#x4d0 . ?ミ)
-       (#x4d1 . ?ム)
-       (#x4d2 . ?メ)
-       (#x4d3 . ?モ)
-       (#x4d4 . ?ヤ)
-       (#x4d5 . ?ユ)
-       (#x4d6 . ?ヨ)
-       (#x4d7 . ?ラ)
-       (#x4d8 . ?リ)
-       (#x4d9 . ?ル)
-       (#x4da . ?レ)
-       (#x4db . ?ロ)
-       (#x4dc . ?ワ)
-       (#x4dd . ?ン)
-       (#x4de . ?゛)
-       (#x4df . ?゜)
-       (#x5ac . ?،)
-       (#x5bb . ?؛)
-       (#x5bf . ?؟)
-       (#x5c1 . ?ء)
-       (#x5c2 . ?آ)
-       (#x5c3 . ?أ)
-       (#x5c4 . ?ؤ)
-       (#x5c5 . ?إ)
-       (#x5c6 . ?ئ)
-       (#x5c7 . ?ا)
-       (#x5c8 . ?ب)
-       (#x5c9 . ?ة)
-       (#x5ca . ?ت)
-       (#x5cb . ?ث)
-       (#x5cc . ?ج)
-       (#x5cd . ?ح)
-       (#x5ce . ?خ)
-       (#x5cf . ?د)
-       (#x5d0 . ?ذ)
-       (#x5d1 . ?ر)
-       (#x5d2 . ?ز)
-       (#x5d3 . ?س)
-       (#x5d4 . ?ش)
-       (#x5d5 . ?ص)
-       (#x5d6 . ?ض)
-       (#x5d7 . ?ط)
-       (#x5d8 . ?ظ)
-       (#x5d9 . ?ع)
-       (#x5da . ?غ)
-       (#x5e0 . ?ـ)
-       (#x5e1 . ?ف)
-       (#x5e2 . ?ق)
-       (#x5e3 . ?ك)
-       (#x5e4 . ?ل)
-       (#x5e5 . ?م)
-       (#x5e6 . ?ن)
-       (#x5e7 . ?ه)
-       (#x5e8 . ?و)
-       (#x5e9 . ?ى)
-       (#x5ea . ?ي)
-       (#x5eb . ?ً)
-       (#x5ec . ?ٌ)
-       (#x5ed . ?ٍ)
-       (#x5ee . ?َ)
-       (#x5ef . ?ُ)
-       (#x5f0 . ?ِ)
-       (#x5f1 . ?ّ)
-       (#x5f2 . ?ْ)
-       (#x6a1 . ?ђ)
-       (#x6a2 . ?ѓ)
-       (#x6a3 . ?ё)
-       (#x6a4 . ?є)
-       (#x6a5 . ?ѕ)
-       (#x6a6 . ?і)
-       (#x6a7 . ?ї)
-       (#x6a8 . ?ј)
-       (#x6a9 . ?љ)
-       (#x6aa . ?њ)
-       (#x6ab . ?ћ)
-       (#x6ac . ?ќ)
-       (#x6ae . ?ў)
-       (#x6af . ?џ)
-       (#x6b0 . ?№)
-       (#x6b1 . ?Ђ)
-       (#x6b2 . ?Ѓ)
-       (#x6b3 . ?Ё)
-       (#x6b4 . ?Є)
-       (#x6b5 . ?Ѕ)
-       (#x6b6 . ?І)
-       (#x6b7 . ?Ї)
-       (#x6b8 . ?Ј)
-       (#x6b9 . ?Љ)
-       (#x6ba . ?Њ)
-       (#x6bb . ?Ћ)
-       (#x6bc . ?Ќ)
-       (#x6be . ?Ў)
-       (#x6bf . ?Џ)
-       (#x6c0 . ?ю)
-       (#x6c1 . ?а)
-       (#x6c2 . ?б)
-       (#x6c3 . ?ц)
-       (#x6c4 . ?д)
-       (#x6c5 . ?е)
-       (#x6c6 . ?ф)
-       (#x6c7 . ?г)
-       (#x6c8 . ?х)
-       (#x6c9 . ?и)
-       (#x6ca . ?й)
-       (#x6cb . ?к)
-       (#x6cc . ?л)
-       (#x6cd . ?м)
-       (#x6ce . ?н)
-       (#x6cf . ?о)
-       (#x6d0 . ?п)
-       (#x6d1 . ?я)
-       (#x6d2 . ?р)
-       (#x6d3 . ?с)
-       (#x6d4 . ?т)
-       (#x6d5 . ?у)
-       (#x6d6 . ?ж)
-       (#x6d7 . ?в)
-       (#x6d8 . ?ь)
-       (#x6d9 . ?ы)
-       (#x6da . ?з)
-       (#x6db . ?ш)
-       (#x6dc . ?э)
-       (#x6dd . ?щ)
-       (#x6de . ?ч)
-       (#x6df . ?ъ)
-       (#x6e0 . ?Ю)
-       (#x6e1 . ?А)
-       (#x6e2 . ?Б)
-       (#x6e3 . ?Ц)
-       (#x6e4 . ?Д)
-       (#x6e5 . ?Е)
-       (#x6e6 . ?Ф)
-       (#x6e7 . ?Г)
-       (#x6e8 . ?Х)
-       (#x6e9 . ?И)
-       (#x6ea . ?Й)
-       (#x6eb . ?К)
-       (#x6ec . ?Л)
-       (#x6ed . ?М)
-       (#x6ee . ?Н)
-       (#x6ef . ?О)
-       (#x6f0 . ?П)
-       (#x6f1 . ?Я)
-       (#x6f2 . ?Р)
-       (#x6f3 . ?С)
-       (#x6f4 . ?Т)
-       (#x6f5 . ?У)
-       (#x6f6 . ?Ж)
-       (#x6f7 . ?В)
-       (#x6f8 . ?Ь)
-       (#x6f9 . ?Ы)
-       (#x6fa . ?З)
-       (#x6fb . ?Ш)
-       (#x6fc . ?Э)
-       (#x6fd . ?Щ)
-       (#x6fe . ?Ч)
-       (#x6ff . ?Ъ)
-       (#x7a1 . ?Ά)
-       (#x7a2 . ?Έ)
-       (#x7a3 . ?Ή)
-       (#x7a4 . ?Ί)
-       (#x7a5 . ?Ϊ)
-       (#x7a7 . ?Ό)
-       (#x7a8 . ?Ύ)
-       (#x7a9 . ?Ϋ)
-       (#x7ab . ?Ώ)
-       (#x7ae . ?΅)
-       (#x7af . ?―)
-       (#x7b1 . ?ά)
-       (#x7b2 . ?έ)
-       (#x7b3 . ?ή)
-       (#x7b4 . ?ί)
-       (#x7b5 . ?ϊ)
-       (#x7b6 . ?ΐ)
-       (#x7b7 . ?ό)
-       (#x7b8 . ?ύ)
-       (#x7b9 . ?ϋ)
-       (#x7ba . ?ΰ)
-       (#x7bb . ?ώ)
-       (#x7c1 . ?Α)
-       (#x7c2 . ?Β)
-       (#x7c3 . ?Γ)
-       (#x7c4 . ?Δ)
-       (#x7c5 . ?Ε)
-       (#x7c6 . ?Ζ)
-       (#x7c7 . ?Η)
-       (#x7c8 . ?Θ)
-       (#x7c9 . ?Ι)
-       (#x7ca . ?Κ)
-       (#x7cb . ?Λ)
-       (#x7cc . ?Μ)
-       (#x7cd . ?Ν)
-       (#x7ce . ?Ξ)
-       (#x7cf . ?Ο)
-       (#x7d0 . ?Π)
-       (#x7d1 . ?Ρ)
-       (#x7d2 . ?Σ)
-       (#x7d4 . ?Τ)
-       (#x7d5 . ?Υ)
-       (#x7d6 . ?Φ)
-       (#x7d7 . ?Χ)
-       (#x7d8 . ?Ψ)
-       (#x7d9 . ?Ω)
-       (#x7e1 . ?α)
-       (#x7e2 . ?β)
-       (#x7e3 . ?γ)
-       (#x7e4 . ?δ)
-       (#x7e5 . ?ε)
-       (#x7e6 . ?ζ)
-       (#x7e7 . ?η)
-       (#x7e8 . ?θ)
-       (#x7e9 . ?ι)
-       (#x7ea . ?κ)
-       (#x7eb . ?λ)
-       (#x7ec . ?μ)
-       (#x7ed . ?ν)
-       (#x7ee . ?ξ)
-       (#x7ef . ?ο)
-       (#x7f0 . ?π)
-       (#x7f1 . ?ρ)
-       (#x7f2 . ?σ)
-       (#x7f3 . ?ς)
-       (#x7f4 . ?τ)
-       (#x7f5 . ?υ)
-       (#x7f6 . ?φ)
-       (#x7f7 . ?χ)
-       (#x7f8 . ?ψ)
-       (#x7f9 . ?ω)
-       (#x8a1 . ?⎷)
-       (#x8a2 . ?┌)
-       (#x8a3 . ?─)
-       (#x8a4 . ?⌠)
-       (#x8a5 . ?⌡)
-       (#x8a6 . ?│)
-       (#x8a7 . ?⎡)
-       (#x8a8 . ?⎣)
-       (#x8a9 . ?⎤)
-       (#x8aa . ?⎦)
-       (#x8ab . ?⎛)
-       (#x8ac . ?⎝)
-       (#x8ad . ?⎞)
-       (#x8ae . ?⎠)
-       (#x8af . ?⎨)
-       (#x8b0 . ?⎬)
-       (#x8bc . ?≤)
-       (#x8bd . ?≠)
-       (#x8be . ?≥)
-       (#x8bf . ?∫)
-       (#x8c0 . ?∴)
-       (#x8c1 . ?∝)
-       (#x8c2 . ?∞)
-       (#x8c5 . ?∇)
-       (#x8c8 . ?∼)
-       (#x8c9 . ?≃)
-       (#x8cd . ?⇔)
-       (#x8ce . ?⇒)
-       (#x8cf . ?≡)
-       (#x8d6 . ?√)
-       (#x8da . ?⊂)
-       (#x8db . ?⊃)
-       (#x8dc . ?∩)
-       (#x8dd . ?∪)
-       (#x8de . ?∧)
-       (#x8df . ?∨)
-       (#x8ef . ?∂)
-       (#x8f6 . ?ƒ)
-       (#x8fb . ?←)
-       (#x8fc . ?↑)
-       (#x8fd . ?→)
-       (#x8fe . ?↓)
-       (#x9e0 . ?◆)
-       (#x9e1 . ?▒)
-       (#x9e2 . ?␉)
-       (#x9e3 . ?␌)
-       (#x9e4 . ?␍)
-       (#x9e5 . ?␊)
-       (#x9e8 . ?␤)
-       (#x9e9 . ?␋)
-       (#x9ea . ?┘)
-       (#x9eb . ?┐)
-       (#x9ec . ?┌)
-       (#x9ed . ?└)
-       (#x9ee . ?┼)
-       (#x9ef . ?⎺)
-       (#x9f0 . ?⎻)
-       (#x9f1 . ?─)
-       (#x9f2 . ?⎼)
-       (#x9f3 . ?⎽)
-       (#x9f4 . ?├)
-       (#x9f5 . ?┤)
-       (#x9f6 . ?┴)
-       (#x9f7 . ?┬)
-       (#x9f8 . ?│)
-       (#xaa1 . ? )
-       (#xaa2 . ? )
-       (#xaa3 . ? )
-       (#xaa4 . ? )
-       (#xaa5 . ? )
-       (#xaa6 . ? )
-       (#xaa7 . ? )
-       (#xaa8 . ? )
-       (#xaa9 . ?—)
-       (#xaaa . ?–)
-       (#xaae . ?…)
-       (#xaaf . ?‥)
-       (#xab0 . ?⅓)
-       (#xab1 . ?⅔)
-       (#xab2 . ?⅕)
-       (#xab3 . ?⅖)
-       (#xab4 . ?⅗)
-       (#xab5 . ?⅘)
-       (#xab6 . ?⅙)
-       (#xab7 . ?⅚)
-       (#xab8 . ?℅)
-       (#xabb . ?‒)
-       (#xabc . ?〈)
-       (#xabe . ?〉)
-       (#xac3 . ?⅛)
-       (#xac4 . ?⅜)
-       (#xac5 . ?⅝)
-       (#xac6 . ?⅞)
-       (#xac9 . ?™)
-       (#xaca . ?☓)
-       (#xacc . ?◁)
-       (#xacd . ?▷)
-       (#xace . ?○)
-       (#xacf . ?▯)
-       (#xad0 . ?‘)
-       (#xad1 . ?’)
-       (#xad2 . ?“)
-       (#xad3 . ?”)
-       (#xad4 . ?℞)
-       (#xad6 . ?′)
-       (#xad7 . ?″)
-       (#xad9 . ?✝)
-       (#xadb . ?▬)
-       (#xadc . ?◀)
-       (#xadd . ?▶)
-       (#xade . ?●)
-       (#xadf . ?▮)
-       (#xae0 . ?◦)
-       (#xae1 . ?▫)
-       (#xae2 . ?▭)
-       (#xae3 . ?△)
-       (#xae4 . ?▽)
-       (#xae5 . ?☆)
-       (#xae6 . ?•)
-       (#xae7 . ?▪)
-       (#xae8 . ?▲)
-       (#xae9 . ?▼)
-       (#xaea . ?☜)
-       (#xaeb . ?☞)
-       (#xaec . ?♣)
-       (#xaed . ?♦)
-       (#xaee . ?♥)
-       (#xaf0 . ?✠)
-       (#xaf1 . ?†)
-       (#xaf2 . ?‡)
-       (#xaf3 . ?✓)
-       (#xaf4 . ?✗)
-       (#xaf5 . ?♯)
-       (#xaf6 . ?♭)
-       (#xaf7 . ?♂)
-       (#xaf8 . ?♀)
-       (#xaf9 . ?☎)
-       (#xafa . ?⌕)
-       (#xafb . ?℗)
-       (#xafc . ?‸)
-       (#xafd . ?‚)
-       (#xafe . ?„)
+      '(
+       ;; Latin-2
+       (#x1a1 . ?\e,B!\e(B)
+       (#x1a2 . ?\e,B"\e(B)
+       (#x1a3 . ?\e,B#\e(B)
+       (#x1a5 . ?\e,B%\e(B)
+       (#x1a6 . ?\e,B&\e(B)
+       (#x1a9 . ?\e,B)\e(B)
+       (#x1aa . ?\e,B*\e(B)
+       (#x1ab . ?\e,B+\e(B)
+       (#x1ac . ?\e,B,\e(B)
+       (#x1ae . ?\e,B.\e(B)
+       (#x1af . ?\e,B/\e(B)
+       (#x1b1 . ?\e,B1\e(B)
+       (#x1b2 . ?\e,B2\e(B)
+       (#x1b3 . ?\e,B3\e(B)
+       (#x1b5 . ?\e,B5\e(B)
+       (#x1b6 . ?\e,B6\e(B)
+       (#x1b7 . ?\e,B7\e(B)
+       (#x1b9 . ?\e,B9\e(B)
+       (#x1ba . ?\e,B:\e(B)
+       (#x1bb . ?\e,B;\e(B)
+       (#x1bc . ?\e,B<\e(B)
+       (#x1bd . ?\e,B=\e(B)
+       (#x1be . ?\e,B>\e(B)
+       (#x1bf . ?\e,B?\e(B)
+       (#x1c0 . ?\e,B@\e(B)
+       (#x1c3 . ?\e,BC\e(B)
+       (#x1c5 . ?\e,BE\e(B)
+       (#x1c6 . ?\e,BF\e(B)
+       (#x1c8 . ?\e,BH\e(B)
+       (#x1ca . ?\e,BJ\e(B)
+       (#x1cc . ?\e,BL\e(B)
+       (#x1cf . ?\e,BO\e(B)
+       (#x1d0 . ?\e,BP\e(B)
+       (#x1d1 . ?\e,BQ\e(B)
+       (#x1d2 . ?\e,BR\e(B)
+       (#x1d5 . ?\e,BU\e(B)
+       (#x1d8 . ?\e,BX\e(B)
+       (#x1d9 . ?\e,BY\e(B)
+       (#x1db . ?\e,B[\e(B)
+       (#x1de . ?\e,B^\e(B)
+       (#x1e0 . ?\e,B`\e(B)
+       (#x1e3 . ?\e,Bc\e(B)
+       (#x1e5 . ?\e,Be\e(B)
+       (#x1e6 . ?\e,Bf\e(B)
+       (#x1e8 . ?\e,Bh\e(B)
+       (#x1ea . ?\e,Bj\e(B)
+       (#x1ec . ?\e,Bl\e(B)
+       (#x1ef . ?\e,Bo\e(B)
+       (#x1f0 . ?\e,Bp\e(B)
+       (#x1f1 . ?\e,Bq\e(B)
+       (#x1f2 . ?\e,Br\e(B)
+       (#x1f5 . ?\e,Bu\e(B)
+       (#x1f8 . ?\e,Bx\e(B)
+       (#x1f9 . ?\e,By\e(B)
+       (#x1fb . ?\e,B{\e(B)
+       (#x1fe . ?\e,B~\e(B)
+       (#x1ff . ?\e,B\7f\e(B)
+       ;; Latin-3
+       (#x2a1 . ?\e,C!\e(B)
+       (#x2a6 . ?\e,C&\e(B)
+       (#x2a9 . ?\e,C)\e(B)
+       (#x2ab . ?\e,C+\e(B)
+       (#x2ac . ?\e,C,\e(B)
+       (#x2b1 . ?\e,C1\e(B)
+       (#x2b6 . ?\e,C6\e(B)
+       (#x2b9 . ?\e,C9\e(B)
+       (#x2bb . ?\e,C;\e(B)
+       (#x2bc . ?\e,C<\e(B)
+       (#x2c5 . ?\e,CE\e(B)
+       (#x2c6 . ?\e,CF\e(B)
+       (#x2d5 . ?\e,CU\e(B)
+       (#x2d8 . ?\e,CX\e(B)
+       (#x2dd . ?\e,C]\e(B)
+       (#x2de . ?\e,C^\e(B)
+       (#x2e5 . ?\e,Ce\e(B)
+       (#x2e6 . ?\e,Cf\e(B)
+       (#x2f5 . ?\e,Cu\e(B)
+       (#x2f8 . ?\e,Cx\e(B)
+       (#x2fd . ?\e,C}\e(B)
+       (#x2fe . ?\e,C~\e(B)
+       ;; Latin-4
+       (#x3a2 . ?\e,D"\e(B)
+       (#x3a3 . ?\e,D#\e(B)
+       (#x3a5 . ?\e,D%\e(B)
+       (#x3a6 . ?\e,D&\e(B)
+       (#x3aa . ?\e,D*\e(B)
+       (#x3ab . ?\e,D+\e(B)
+       (#x3ac . ?\e,D,\e(B)
+       (#x3b3 . ?\e,D3\e(B)
+       (#x3b5 . ?\e,D5\e(B)
+       (#x3b6 . ?\e,D6\e(B)
+       (#x3ba . ?\e,D:\e(B)
+       (#x3bb . ?\e,D;\e(B)
+       (#x3bc . ?\e,D<\e(B)
+       (#x3bd . ?\e,D=\e(B)
+       (#x3bf . ?\e,D?\e(B)
+       (#x3c0 . ?\e,D@\e(B)
+       (#x3c7 . ?\e,DG\e(B)
+       (#x3cc . ?\e,DL\e(B)
+       (#x3cf . ?\e,DO\e(B)
+       (#x3d1 . ?\e,DQ\e(B)
+       (#x3d2 . ?\e,DR\e(B)
+       (#x3d3 . ?\e,DS\e(B)
+       (#x3d9 . ?\e,DY\e(B)
+       (#x3dd . ?\e,D]\e(B)
+       (#x3de . ?\e,D^\e(B)
+       (#x3e0 . ?\e,D`\e(B)
+       (#x3e7 . ?\e,Dg\e(B)
+       (#x3ec . ?\e,Dl\e(B)
+       (#x3ef . ?\e,Do\e(B)
+       (#x3f1 . ?\e,Dq\e(B)
+       (#x3f2 . ?\e,Dr\e(B)
+       (#x3f3 . ?\e,Ds\e(B)
+       (#x3f9 . ?\e,Dy\e(B)
+       (#x3fd . ?\e,D}\e(B)
+       (#x3fe . ?\e,D~\e(B)
+       ;; Kana: Fixme: needs conversion to Japanese charset -- seems
+       ;; to require jisx0213, for which the Unicode translation
+       ;; isn't clear.
+       (#x47e . ?\e$,1s>\e(B)
+       (#x4a1 . ?\e$,2=B\e(B)
+       (#x4a2 . ?\\e$,2=L\e(B)
+       (#x4a3 . ?\\e$,2=M\e(B)
+       (#x4a4 . ?\e$,2=A\e(B)
+       (#x4a5 . ?\e$,2?{\e(B)
+       (#x4a6 . ?\e$,2?r\e(B)
+       (#x4a7 . ?\e$,2?!\e(B)
+       (#x4a8 . ?\e$,2?#\e(B)
+       (#x4a9 . ?\e$,2?%\e(B)
+       (#x4aa . ?\e$,2?'\e(B)
+       (#x4ab . ?\e$,2?)\e(B)
+       (#x4ac . ?\e$,2?c\e(B)
+       (#x4ad . ?\e$,2?e\e(B)
+       (#x4ae . ?\e$,2?g\e(B)
+       (#x4af . ?\e$,2?C\e(B)
+       (#x4b0 . ?\e$,2?|\e(B)
+       (#x4b1 . ?\e$,2?"\e(B)
+       (#x4b2 . ?\e$,2?$\e(B)
+       (#x4b3 . ?\e$,2?&\e(B)
+       (#x4b4 . ?\e$,2?(\e(B)
+       (#x4b5 . ?\e$,2?*\e(B)
+       (#x4b6 . ?\e$,2?+\e(B)
+       (#x4b7 . ?\e$,2?-\e(B)
+       (#x4b8 . ?\e$,2?/\e(B)
+       (#x4b9 . ?\e$,2?1\e(B)
+       (#x4ba . ?\e$,2?3\e(B)
+       (#x4bb . ?\e$,2?5\e(B)
+       (#x4bc . ?\e$,2?7\e(B)
+       (#x4bd . ?\e$,2?9\e(B)
+       (#x4be . ?\e$,2?;\e(B)
+       (#x4bf . ?\e$,2?=\e(B)
+       (#x4c0 . ?\e$,2??\e(B)
+       (#x4c1 . ?\e$,2?A\e(B)
+       (#x4c2 . ?\e$,2?D\e(B)
+       (#x4c3 . ?\e$,2?F\e(B)
+       (#x4c4 . ?\e$,2?H\e(B)
+       (#x4c5 . ?\e$,2?J\e(B)
+       (#x4c6 . ?\e$,2?K\e(B)
+       (#x4c7 . ?\e$,2?L\e(B)
+       (#x4c8 . ?\e$,2?M\e(B)
+       (#x4c9 . ?\e$,2?N\e(B)
+       (#x4ca . ?\e$,2?O\e(B)
+       (#x4cb . ?\e$,2?R\e(B)
+       (#x4cc . ?\e$,2?U\e(B)
+       (#x4cd . ?\e$,2?X\e(B)
+       (#x4ce . ?\e$,2?[\e(B)
+       (#x4cf . ?\e$,2?^\e(B)
+       (#x4d0 . ?\e$,2?_\e(B)
+       (#x4d1 . ?\e$,2?`\e(B)
+       (#x4d2 . ?\e$,2?a\e(B)
+       (#x4d3 . ?\e$,2?b\e(B)
+       (#x4d4 . ?\e$,2?d\e(B)
+       (#x4d5 . ?\e$,2?f\e(B)
+       (#x4d6 . ?\e$,2?h\e(B)
+       (#x4d7 . ?\e$,2?i\e(B)
+       (#x4d8 . ?\e$,2?j\e(B)
+       (#x4d9 . ?\e$,2?k\e(B)
+       (#x4da . ?\e$,2?l\e(B)
+       (#x4db . ?\e$,2?m\e(B)
+       (#x4dc . ?\e$,2?o\e(B)
+       (#x4dd . ?\e$,2?s\e(B)
+       (#x4de . ?\e$,2>{\e(B)
+       (#x4df . ?\e$,2>|\e(B)
+       ;; Arabic
+       (#x5ac . ?\e,G,\e(B)
+       (#x5bb . ?\e,G;\e(B)
+       (#x5bf . ?\e,G?\e(B)
+       (#x5c1 . ?\e,GA\e(B)
+       (#x5c2 . ?\e,GB\e(B)
+       (#x5c3 . ?\e,GC\e(B)
+       (#x5c4 . ?\e,GD\e(B)
+       (#x5c5 . ?\e,GE\e(B)
+       (#x5c6 . ?\e,GF\e(B)
+       (#x5c7 . ?\e,GG\e(B)
+       (#x5c8 . ?\e,GH\e(B)
+       (#x5c9 . ?\e,GI\e(B)
+       (#x5ca . ?\e,GJ\e(B)
+       (#x5cb . ?\e,GK\e(B)
+       (#x5cc . ?\e,GL\e(B)
+       (#x5cd . ?\e,GM\e(B)
+       (#x5ce . ?\e,GN\e(B)
+       (#x5cf . ?\e,GO\e(B)
+       (#x5d0 . ?\e,GP\e(B)
+       (#x5d1 . ?\e,GQ\e(B)
+       (#x5d2 . ?\e,GR\e(B)
+       (#x5d3 . ?\e,GS\e(B)
+       (#x5d4 . ?\e,GT\e(B)
+       (#x5d5 . ?\e,GU\e(B)
+       (#x5d6 . ?\e,GV\e(B)
+       (#x5d7 . ?\e,GW\e(B)
+       (#x5d8 . ?\e,GX\e(B)
+       (#x5d9 . ?\e,GY\e(B)
+       (#x5da . ?\e,GZ\e(B)
+       (#x5e0 . ?\e,G`\e(B)
+       (#x5e1 . ?\e,Ga\e(B)
+       (#x5e2 . ?\e,Gb\e(B)
+       (#x5e3 . ?\e,Gc\e(B)
+       (#x5e4 . ?\e,Gd\e(B)
+       (#x5e5 . ?\e,Ge\e(B)
+       (#x5e6 . ?\e,Gf\e(B)
+       (#x5e7 . ?\e,Gg\e(B)
+       (#x5e8 . ?\e,Gh\e(B)
+       (#x5e9 . ?\e,Gi\e(B)
+       (#x5ea . ?\e,Gj\e(B)
+       (#x5eb . ?\e,Gk\e(B)
+       (#x5ec . ?\e,Gl\e(B)
+       (#x5ed . ?\e,Gm\e(B)
+       (#x5ee . ?\e,Gn\e(B)
+       (#x5ef . ?\e,Go\e(B)
+       (#x5f0 . ?\e,Gp\e(B)
+       (#x5f1 . ?\e,Gq\e(B)
+       (#x5f2 . ?\e,Gr\e(B)
+       ;; Cyrillic
+       (#x6a1 . ?\e,Lr\e(B)
+       (#x6a2 . ?\e,Ls\e(B)
+       (#x6a3 . ?\e,Lq\e(B)
+       (#x6a4 . ?\e,Lt\e(B)
+       (#x6a5 . ?\e,Lu\e(B)
+       (#x6a6 . ?\e,Lv\e(B)
+       (#x6a7 . ?\e,Lw\e(B)
+       (#x6a8 . ?\e,Lx\e(B)
+       (#x6a9 . ?\e,Ly\e(B)
+       (#x6aa . ?\e,Lz\e(B)
+       (#x6ab . ?\e,L{\e(B)
+       (#x6ac . ?\e,L|\e(B)
+       (#x6ae . ?\e,L~\e(B)
+       (#x6af . ?\e,L\7f\e(B)
+       (#x6b0 . ?\e,Lp\e(B)
+       (#x6b1 . ?\e,L"\e(B)
+       (#x6b2 . ?\e,L#\e(B)
+       (#x6b3 . ?\e,L!\e(B)
+       (#x6b4 . ?\e,L$\e(B)
+       (#x6b5 . ?\e,L%\e(B)
+       (#x6b6 . ?\e,L&\e(B)
+       (#x6b7 . ?\e,L'\e(B)
+       (#x6b8 . ?\e,L(\e(B)
+       (#x6b9 . ?\e,L)\e(B)
+       (#x6ba . ?\e,L*\e(B)
+       (#x6bb . ?\e,L+\e(B)
+       (#x6bc . ?\e,L,\e(B)
+       (#x6be . ?\e,L.\e(B)
+       (#x6bf . ?\e,L/\e(B)
+       (#x6c0 . ?\e,Ln\e(B)
+       (#x6c1 . ?\e,LP\e(B)
+       (#x6c2 . ?\e,LQ\e(B)
+       (#x6c3 . ?\e,Lf\e(B)
+       (#x6c4 . ?\e,LT\e(B)
+       (#x6c5 . ?\e,LU\e(B)
+       (#x6c6 . ?\e,Ld\e(B)
+       (#x6c7 . ?\e,LS\e(B)
+       (#x6c8 . ?\e,Le\e(B)
+       (#x6c9 . ?\e,LX\e(B)
+       (#x6ca . ?\e,LY\e(B)
+       (#x6cb . ?\e,LZ\e(B)
+       (#x6cc . ?\e,L[\e(B)
+       (#x6cd . ?\e,L\\e(B)
+       (#x6ce . ?\e,L]\e(B)
+       (#x6cf . ?\e,L^\e(B)
+       (#x6d0 . ?\e,L_\e(B)
+       (#x6d1 . ?\e,Lo\e(B)
+       (#x6d2 . ?\e,L`\e(B)
+       (#x6d3 . ?\e,La\e(B)
+       (#x6d4 . ?\e,Lb\e(B)
+       (#x6d5 . ?\e,Lc\e(B)
+       (#x6d6 . ?\e,LV\e(B)
+       (#x6d7 . ?\e,LR\e(B)
+       (#x6d8 . ?\e,Ll\e(B)
+       (#x6d9 . ?\e,Lk\e(B)
+       (#x6da . ?\e,LW\e(B)
+       (#x6db . ?\e,Lh\e(B)
+       (#x6dc . ?\e,Lm\e(B)
+       (#x6dd . ?\e,Li\e(B)
+       (#x6de . ?\e,Lg\e(B)
+       (#x6df . ?\e,Lj\e(B)
+       (#x6e0 . ?\e,LN\e(B)
+       (#x6e1 . ?\e,L0\e(B)
+       (#x6e2 . ?\e,L1\e(B)
+       (#x6e3 . ?\e,LF\e(B)
+       (#x6e4 . ?\e,L4\e(B)
+       (#x6e5 . ?\e,L5\e(B)
+       (#x6e6 . ?\e,LD\e(B)
+       (#x6e7 . ?\e,L3\e(B)
+       (#x6e8 . ?\e,LE\e(B)
+       (#x6e9 . ?\e,L8\e(B)
+       (#x6ea . ?\e,L9\e(B)
+       (#x6eb . ?\e,L:\e(B)
+       (#x6ec . ?\e,L;\e(B)
+       (#x6ed . ?\e,L<\e(B)
+       (#x6ee . ?\e,L=\e(B)
+       (#x6ef . ?\e,L>\e(B)
+       (#x6f0 . ?\e,L?\e(B)
+       (#x6f1 . ?\e,LO\e(B)
+       (#x6f2 . ?\e,L@\e(B)
+       (#x6f3 . ?\e,LA\e(B)
+       (#x6f4 . ?\e,LB\e(B)
+       (#x6f5 . ?\e,LC\e(B)
+       (#x6f6 . ?\e,L6\e(B)
+       (#x6f7 . ?\e,L2\e(B)
+       (#x6f8 . ?\e,LL\e(B)
+       (#x6f9 . ?\e,LK\e(B)
+       (#x6fa . ?\e,L7\e(B)
+       (#x6fb . ?\e,LH\e(B)
+       (#x6fc . ?\e,LM\e(B)
+       (#x6fd . ?\e,LI\e(B)
+       (#x6fe . ?\e,LG\e(B)
+       (#x6ff . ?\e,LJ\e(B)
+       ;; Greek
+       (#x7a1 . ?\e,F6\e(B)
+       (#x7a2 . ?\e,F8\e(B)
+       (#x7a3 . ?\e,F9\e(B)
+       (#x7a4 . ?\e,F:\e(B)
+       (#x7a5 . ?\e,FZ\e(B)
+       (#x7a7 . ?\e,F<\e(B)
+       (#x7a8 . ?\e,F>\e(B)
+       (#x7a9 . ?\e,F[\e(B)
+       (#x7ab . ?\e,F?\e(B)
+       (#x7ae . ?\e,F5\e(B)
+       (#x7af . ?\e,F/\e(B)
+       (#x7b1 . ?\e,F\\e(B)
+       (#x7b2 . ?\e,F]\e(B)
+       (#x7b3 . ?\e,F^\e(B)
+       (#x7b4 . ?\e,F_\e(B)
+       (#x7b5 . ?\e,Fz\e(B)
+       (#x7b6 . ?\e,F@\e(B)
+       (#x7b7 . ?\e,F|\e(B)
+       (#x7b8 . ?\e,F}\e(B)
+       (#x7b9 . ?\e,F{\e(B)
+       (#x7ba . ?\e,F`\e(B)
+       (#x7bb . ?\e,F~\e(B)
+       (#x7c1 . ?\e,FA\e(B)
+       (#x7c2 . ?\e,FB\e(B)
+       (#x7c3 . ?\e,FC\e(B)
+       (#x7c4 . ?\e,FD\e(B)
+       (#x7c5 . ?\e,FE\e(B)
+       (#x7c6 . ?\e,FF\e(B)
+       (#x7c7 . ?\e,FG\e(B)
+       (#x7c8 . ?\e,FH\e(B)
+       (#x7c9 . ?\e,FI\e(B)
+       (#x7ca . ?\e,FJ\e(B)
+       (#x7cb . ?\e,FK\e(B)
+       (#x7cc . ?\e,FL\e(B)
+       (#x7cd . ?\e,FM\e(B)
+       (#x7ce . ?\e,FN\e(B)
+       (#x7cf . ?\e,FO\e(B)
+       (#x7d0 . ?\e,FP\e(B)
+       (#x7d1 . ?\e,FQ\e(B)
+       (#x7d2 . ?\e,FS\e(B)
+       (#x7d4 . ?\e,FT\e(B)
+       (#x7d5 . ?\e,FU\e(B)
+       (#x7d6 . ?\e,FV\e(B)
+       (#x7d7 . ?\e,FW\e(B)
+       (#x7d8 . ?\e,FX\e(B)
+       (#x7d9 . ?\e,FY\e(B)
+       (#x7e1 . ?\e,Fa\e(B)
+       (#x7e2 . ?\e,Fb\e(B)
+       (#x7e3 . ?\e,Fc\e(B)
+       (#x7e4 . ?\e,Fd\e(B)
+       (#x7e5 . ?\e,Fe\e(B)
+       (#x7e6 . ?\e,Ff\e(B)
+       (#x7e7 . ?\e,Fg\e(B)
+       (#x7e8 . ?\e,Fh\e(B)
+       (#x7e9 . ?\e,Fi\e(B)
+       (#x7ea . ?\e,Fj\e(B)
+       (#x7eb . ?\e,Fk\e(B)
+       (#x7ec . ?\e,Fl\e(B)
+       (#x7ed . ?\e,Fm\e(B)
+       (#x7ee . ?\e,Fn\e(B)
+       (#x7ef . ?\e,Fo\e(B)
+       (#x7f0 . ?\e,Fp\e(B)
+       (#x7f1 . ?\e,Fq\e(B)
+       (#x7f2 . ?\e,Fs\e(B)
+       (#x7f3 . ?\e,Fr\e(B)
+       (#x7f4 . ?\e,Ft\e(B)
+       (#x7f5 . ?\e,Fu\e(B)
+       (#x7f6 . ?\e,Fv\e(B)
+       (#x7f7 . ?\e,Fw\e(B)
+       (#x7f8 . ?\e,Fx\e(B)
+       (#x7f9 . ?\e,Fy\e(B)
+        ;; Technical
+       (#x8a1 . ?\e$,1|W\e(B)
+       (#x8a2 . ?\e$,2 ,\e(B)
+       (#x8a3 . ?\e$,2  \e(B)
+       (#x8a4 . ?\e$,1{ \e(B)
+       (#x8a5 . ?\e$,1{!\e(B)
+       (#x8a6 . ?\e$,2 "\e(B)
+       (#x8a7 . ?\e$,1|A\e(B)
+       (#x8a8 . ?\e$,1|C\e(B)
+       (#x8a9 . ?\e$,1|D\e(B)
+       (#x8aa . ?\e$,1|F\e(B)
+       (#x8ab . ?\e$,1|;\e(B)
+       (#x8ac . ?\e$,1|=\e(B)
+       (#x8ad . ?\e$,1|>\e(B)
+       (#x8ae . ?\e$,1|@\e(B)
+       (#x8af . ?\e$,1|H\e(B)
+       (#x8b0 . ?\e$,1|L\e(B)
+       (#x8bc . ?\e$,1y$\e(B)
+       (#x8bd . ?\e$,1y \e(B)
+       (#x8be . ?\e$,1y%\e(B)
+       (#x8bf . ?\e$,1xK\e(B)
+       (#x8c0 . ?\e$,1xT\e(B)
+       (#x8c1 . ?\e$,1x=\e(B)
+       (#x8c2 . ?\e$,1x>\e(B)
+       (#x8c5 . ?\e$,1x'\e(B)
+       (#x8c8 . ?\e$,1x\\e(B)
+       (#x8c9 . ?\e$,1xc\e(B)
+       (#x8cd . ?\e$,1wT\e(B)
+       (#x8ce . ?\e$,1wR\e(B)
+       (#x8cf . ?\e$,1y!\e(B)
+       (#x8d6 . ?\e$,1x:\e(B)
+       (#x8da . ?\e$,1yB\e(B)
+       (#x8db . ?\e$,1yC\e(B)
+       (#x8dc . ?\e$,1xI\e(B)
+       (#x8dd . ?\e$,1xJ\e(B)
+       (#x8de . ?\e$,1xG\e(B)
+       (#x8df . ?\e$,1xH\e(B)
+       (#x8ef . ?\e$,1x"\e(B)
+       (#x8f6 . ?\e$,1!R\e(B)
+       (#x8fb . ?\e$,1vp\e(B)
+       (#x8fc . ?\e$,1vq\e(B)
+       (#x8fd . ?\e$,1vr\e(B)
+       (#x8fe . ?\e$,1vs\e(B)
+       ;; Special
+       (#x9e0 . ?\e$,2"&\e(B)
+       (#x9e1 . ?\e$,2!R\e(B)
+       (#x9e2 . ?\e$,1}I\e(B)
+       (#x9e3 . ?\e$,1}L\e(B)
+       (#x9e4 . ?\e$,1}M\e(B)
+       (#x9e5 . ?\e$,1}J\e(B)
+       (#x9e8 . ?\e$,1}d\e(B)
+       (#x9e9 . ?\e$,1}K\e(B)
+       (#x9ea . ?\e$,2 8\e(B)
+       (#x9eb . ?\e$,2 0\e(B)
+       (#x9ec . ?\e$,2 ,\e(B)
+       (#x9ed . ?\e$,2 4\e(B)
+       (#x9ee . ?\e$,2 \\e(B)
+       (#x9ef . ?\e$,1|Z\e(B)
+       (#x9f0 . ?\e$,1|[\e(B)
+       (#x9f1 . ?\e$,2  \e(B)
+       (#x9f2 . ?\e$,1|\\e(B)
+       (#x9f3 . ?\e$,1|]\e(B)
+       (#x9f4 . ?\e$,2 <\e(B)
+       (#x9f5 . ?\e$,2 D\e(B)
+       (#x9f6 . ?\e$,2 T\e(B)
+       (#x9f7 . ?\e$,2 L\e(B)
+       (#x9f8 . ?\e$,2 "\e(B)
+       ;; Publishing
+       (#xaa1 . ?\e$,1rc\e(B)
+       (#xaa2 . ?\e$,1rb\e(B)
+       (#xaa3 . ?\e$,1rd\e(B)
+       (#xaa4 . ?\e$,1re\e(B)
+       (#xaa5 . ?\e$,1rg\e(B)
+       (#xaa6 . ?\e$,1rh\e(B)
+       (#xaa7 . ?\e$,1ri\e(B)
+       (#xaa8 . ?\e$,1rj\e(B)
+       (#xaa9 . ?\e$,1rt\e(B)
+       (#xaaa . ?\e$,1rs\e(B)
+       (#xaae . ?\e$,1s&\e(B)
+       (#xaaf . ?\e$,1s%\e(B)
+       (#xab0 . ?\e$,1v3\e(B)
+       (#xab1 . ?\e$,1v4\e(B)
+       (#xab2 . ?\e$,1v5\e(B)
+       (#xab3 . ?\e$,1v6\e(B)
+       (#xab4 . ?\e$,1v7\e(B)
+       (#xab5 . ?\e$,1v8\e(B)
+       (#xab6 . ?\e$,1v9\e(B)
+       (#xab7 . ?\e$,1v:\e(B)
+       (#xab8 . ?\e$,1uE\e(B)
+       (#xabb . ?\e$,1rr\e(B)
+       (#xabc . ?\e$,1{)\e(B)
+       (#xabe . ?\e$,1{*\e(B)
+       (#xac3 . ?\e$,1v;\e(B)
+       (#xac4 . ?\e$,1v<\e(B)
+       (#xac5 . ?\e$,1v=\e(B)
+       (#xac6 . ?\e$,1v>\e(B)
+       (#xac9 . ?\e$,1ub\e(B)
+       (#xaca . ?\e$,2"s\e(B)
+       (#xacc . ?\e$,2"!\e(B)
+       (#xacd . ?\e$,2!w\e(B)
+       (#xace . ?\e$,2"+\e(B)
+       (#xacf . ?\e$,2!o\e(B)
+       (#xad0 . ?\e$,1rx\e(B)
+       (#xad1 . ?\e$,1ry\e(B)
+       (#xad2 . ?\e$,1r|\e(B)
+       (#xad3 . ?\e$,1r}\e(B)
+       (#xad4 . ?\e$,1u^\e(B)
+       (#xad6 . ?\e$,1s2\e(B)
+       (#xad7 . ?\e$,1s3\e(B)
+       (#xad9 . ?\e$,2%]\e(B)
+       (#xadb . ?\e$,2!l\e(B)
+       (#xadc . ?\e$,2" \e(B)
+       (#xadd . ?\e$,2!v\e(B)
+       (#xade . ?\e$,2"/\e(B)
+       (#xadf . ?\e$,2!n\e(B)
+       (#xae0 . ?\e$,2"F\e(B)
+       (#xae1 . ?\e$,2!k\e(B)
+       (#xae2 . ?\e$,2!m\e(B)
+       (#xae3 . ?\e$,2!s\e(B)
+       (#xae4 . ?\e$,2!}\e(B)
+       (#xae5 . ?\e$,2"f\e(B)
+       (#xae6 . ?\e$,1s"\e(B)
+       (#xae7 . ?\e$,2!j\e(B)
+       (#xae8 . ?\e$,2!r\e(B)
+       (#xae9 . ?\e$,2!|\e(B)
+       (#xaea . ?\e$,2"|\e(B)
+       (#xaeb . ?\e$,2"~\e(B)
+       (#xaec . ?\e$,2#c\e(B)
+       (#xaed . ?\e$,2#f\e(B)
+       (#xaee . ?\e$,2#e\e(B)
+       (#xaf0 . ?\e$,2%`\e(B)
+       (#xaf1 . ?\e$,1s \e(B)
+       (#xaf2 . ?\e$,1s!\e(B)
+       (#xaf3 . ?\e$,2%S\e(B)
+       (#xaf4 . ?\e$,2%W\e(B)
+       (#xaf5 . ?\e$,2#o\e(B)
+       (#xaf6 . ?\e$,2#m\e(B)
+       (#xaf7 . ?\e$,2#B\e(B)
+       (#xaf8 . ?\e$,2#@\e(B)
+       (#xaf9 . ?\e$,2"n\e(B)
+       (#xafa . ?\e$,1zu\e(B)
+       (#xafb . ?\e$,1uW\e(B)
+       (#xafc . ?\e$,1s8\e(B)
+       (#xafd . ?\e$,1rz\e(B)
+       (#xafe . ?\e$,1r~\e(B)
+       ;; APL
        (#xba3 . ?<)
        (#xba6 . ?>)
-       (#xba8 . ?)
-       (#xba9 . ?)
-       (#xbc0 . ?¯)
-       (#xbc2 . ?)
-       (#xbc3 . ?)
-       (#xbc4 . ?)
+       (#xba8 . ?\e$,1xH\e(B)
+       (#xba9 . ?\e$,1xG\e(B)
+       (#xbc0 . ?\e,A/\e(B)
+       (#xbc2 . ?\e$,1ye\e(B)
+       (#xbc3 . ?\e$,1xI\e(B)
+       (#xbc4 . ?\e$,1zj\e(B)
        (#xbc6 . ?_)
-       (#xbca . ?∘)
-       (#xbcc . ?⎕)
-       (#xbce . ?⊤)
-       (#xbcf . ?○)
-       (#xbd3 . ?⌈)
-       (#xbd6 . ?∪)
-       (#xbd8 . ?⊃)
-       (#xbda . ?⊂)
-       (#xbdc . ?⊢)
-       (#xbfc . ?⊣)
-       (#xcdf . ?‗)
-       (#xce0 . ?א)
-       (#xce1 . ?ב)
-       (#xce2 . ?ג)
-       (#xce3 . ?ד)
-       (#xce4 . ?ה)
-       (#xce5 . ?ו)
-       (#xce6 . ?ז)
-       (#xce7 . ?ח)
-       (#xce8 . ?ט)
-       (#xce9 . ?י)
-       (#xcea . ?ך)
-       (#xceb . ?כ)
-       (#xcec . ?ל)
-       (#xced . ?ם)
-       (#xcee . ?מ)
-       (#xcef . ?ן)
-       (#xcf0 . ?נ)
-       (#xcf1 . ?ס)
-       (#xcf2 . ?ע)
-       (#xcf3 . ?ף)
-       (#xcf4 . ?פ)
-       (#xcf5 . ?ץ)
-       (#xcf6 . ?צ)
-       (#xcf7 . ?ק)
-       (#xcf8 . ?ר)
-       (#xcf9 . ?ש)
-       (#xcfa . ?ת)
-       (#xda1 . ?ก)
-       (#xda2 . ?ข)
-       (#xda3 . ?ฃ)
-       (#xda4 . ?ค)
-       (#xda5 . ?ฅ)
-       (#xda6 . ?ฆ)
-       (#xda7 . ?ง)
-       (#xda8 . ?จ)
-       (#xda9 . ?ฉ)
-       (#xdaa . ?ช)
-       (#xdab . ?ซ)
-       (#xdac . ?ฌ)
-       (#xdad . ?ญ)
-       (#xdae . ?ฎ)
-       (#xdaf . ?ฏ)
-       (#xdb0 . ?ฐ)
-       (#xdb1 . ?ฑ)
-       (#xdb2 . ?ฒ)
-       (#xdb3 . ?ณ)
-       (#xdb4 . ?ด)
-       (#xdb5 . ?ต)
-       (#xdb6 . ?ถ)
-       (#xdb7 . ?ท)
-       (#xdb8 . ?ธ)
-       (#xdb9 . ?น)
-       (#xdba . ?บ)
-       (#xdbb . ?ป)
-       (#xdbc . ?ผ)
-       (#xdbd . ?ฝ)
-       (#xdbe . ?พ)
-       (#xdbf . ?ฟ)
-       (#xdc0 . ?ภ)
-       (#xdc1 . ?ม)
-       (#xdc2 . ?ย)
-       (#xdc3 . ?ร)
-       (#xdc4 . ?ฤ)
-       (#xdc5 . ?ล)
-       (#xdc6 . ?ฦ)
-       (#xdc7 . ?ว)
-       (#xdc8 . ?ศ)
-       (#xdc9 . ?ษ)
-       (#xdca . ?ส)
-       (#xdcb . ?ห)
-       (#xdcc . ?ฬ)
-       (#xdcd . ?อ)
-       (#xdce . ?ฮ)
-       (#xdcf . ?ฯ)
-       (#xdd0 . ?ะ)
-       (#xdd1 . ?ั)
-       (#xdd2 . ?า)
-       (#xdd3 . ?ำ)
-       (#xdd4 . ?ิ)
-       (#xdd5 . ?ี)
-       (#xdd6 . ?ึ)
-       (#xdd7 . ?ื)
-       (#xdd8 . ?ุ)
-       (#xdd9 . ?ู)
-       (#xdda . ?ฺ)
-       (#xddf . ?฿)
-       (#xde0 . ?เ)
-       (#xde1 . ?แ)
-       (#xde2 . ?โ)
-       (#xde3 . ?ใ)
-       (#xde4 . ?ไ)
-       (#xde5 . ?ๅ)
-       (#xde6 . ?ๆ)
-       (#xde7 . ?็)
-       (#xde8 . ?่)
-       (#xde9 . ?้)
-       (#xdea . ?๊)
-       (#xdeb . ?๋)
-       (#xdec . ?์)
-       (#xded . ?ํ)
-       (#xdf0 . ?๐)
-       (#xdf1 . ?๑)
-       (#xdf2 . ?๒)
-       (#xdf3 . ?๓)
-       (#xdf4 . ?๔)
-       (#xdf5 . ?๕)
-       (#xdf6 . ?๖)
-       (#xdf7 . ?๗)
-       (#xdf8 . ?๘)
-       (#xdf9 . ?๙)
-       (#xea1 . ?ㄱ)
-       (#xea2 . ?ㄲ)
-       (#xea3 . ?ㄳ)
-       (#xea4 . ?ㄴ)
-       (#xea5 . ?ㄵ)
-       (#xea6 . ?ㄶ)
-       (#xea7 . ?ㄷ)
-       (#xea8 . ?ㄸ)
-       (#xea9 . ?ㄹ)
-       (#xeaa . ?ㄺ)
-       (#xeab . ?ㄻ)
-       (#xeac . ?ㄼ)
-       (#xead . ?ㄽ)
-       (#xeae . ?ㄾ)
-       (#xeaf . ?ㄿ)
-       (#xeb0 . ?ㅀ)
-       (#xeb1 . ?ㅁ)
-       (#xeb2 . ?ㅂ)
-       (#xeb3 . ?ㅃ)
-       (#xeb4 . ?ㅄ)
-       (#xeb5 . ?ㅅ)
-       (#xeb6 . ?ㅆ)
-       (#xeb7 . ?ㅇ)
-       (#xeb8 . ?ㅈ)
-       (#xeb9 . ?ㅉ)
-       (#xeba . ?ㅊ)
-       (#xebb . ?ㅋ)
-       (#xebc . ?ㅌ)
-       (#xebd . ?ㅍ)
-       (#xebe . ?ㅎ)
-       (#xebf . ?ㅏ)
-       (#xec0 . ?ㅐ)
-       (#xec1 . ?ㅑ)
-       (#xec2 . ?ㅒ)
-       (#xec3 . ?ㅓ)
-       (#xec4 . ?ㅔ)
-       (#xec5 . ?ㅕ)
-       (#xec6 . ?ㅖ)
-       (#xec7 . ?ㅗ)
-       (#xec8 . ?ㅘ)
-       (#xec9 . ?ㅙ)
-       (#xeca . ?ㅚ)
-       (#xecb . ?ㅛ)
-       (#xecc . ?ㅜ)
-       (#xecd . ?ㅝ)
-       (#xece . ?ㅞ)
-       (#xecf . ?ㅟ)
-       (#xed0 . ?ㅠ)
-       (#xed1 . ?ㅡ)
-       (#xed2 . ?ㅢ)
-       (#xed3 . ?ㅣ)
-       (#xed4 . ?ᆨ)
-       (#xed5 . ?ᆩ)
-       (#xed6 . ?ᆪ)
-       (#xed7 . ?ᆫ)
-       (#xed8 . ?ᆬ)
-       (#xed9 . ?ᆭ)
-       (#xeda . ?ᆮ)
-       (#xedb . ?ᆯ)
-       (#xedc . ?ᆰ)
-       (#xedd . ?ᆱ)
-       (#xede . ?ᆲ)
-       (#xedf . ?ᆳ)
-       (#xee0 . ?ᆴ)
-       (#xee1 . ?ᆵ)
-       (#xee2 . ?ᆶ)
-       (#xee3 . ?ᆷ)
-       (#xee4 . ?ᆸ)
-       (#xee5 . ?ᆹ)
-       (#xee6 . ?ᆺ)
-       (#xee7 . ?ᆻ)
-       (#xee8 . ?ᆼ)
-       (#xee9 . ?ᆽ)
-       (#xeea . ?ᆾ)
-       (#xeeb . ?ᆿ)
-       (#xeec . ?ᇀ)
-       (#xeed . ?ᇁ)
-       (#xeee . ?ᇂ)
-       (#xeef . ?ㅭ)
-       (#xef0 . ?ㅱ)
-       (#xef1 . ?ㅸ)
-       (#xef2 . ?ㅿ)
-       (#xef3 . ?ㆁ)
-       (#xef4 . ?ㆄ)
-       (#xef5 . ?ㆆ)
-       (#xef6 . ?ㆍ)
-       (#xef7 . ?ㆎ)
-       (#xef8 . ?ᇫ)
-       (#xef9 . ?ᇰ)
-       (#xefa . ?ᇹ)
-       (#xeff . ?₩)
-       (#x13bc . ?Œ)
-       (#x13bd . ?œ)
-       (#x13be . ?Ÿ)
-       (#x20a0 . ?₠)
-       (#x20a1 . ?₡)
-       (#x20a2 . ?₢)
-       (#x20a3 . ?₣)
-       (#x20a4 . ?₤)
-       (#x20a5 . ?₥)
-       (#x20a6 . ?₦)
-       (#x20a7 . ?₧)
-       (#x20a8 . ?₨)
-       (#x20aa . ?₪)
-       (#x20ab . ?₫)
-       (#x20ac . ?€)))
+       (#xbca . ?\e$,1x8\e(B)
+       (#xbcc . ?\e$,1|5\e(B)
+       (#xbce . ?\e$,1yd\e(B)
+       (#xbcf . ?\e$,2"+\e(B)
+       (#xbd3 . ?\e$,1zh\e(B)
+       (#xbd6 . ?\e$,1xJ\e(B)
+       (#xbd8 . ?\e$,1yC\e(B)
+       (#xbda . ?\e$,1yB\e(B)
+       (#xbdc . ?\e$,1yb\e(B)
+       (#xbfc . ?\e$,1yc\e(B)
+       ;; Hebrew
+       (#xcdf . ?\e,H_\e(B)
+       (#xce0 . ?\e,H`\e(B)
+       (#xce1 . ?\e,Ha\e(B)
+       (#xce2 . ?\e,Hb\e(B)
+       (#xce3 . ?\e,Hc\e(B)
+       (#xce4 . ?\e,Hd\e(B)
+       (#xce5 . ?\e,He\e(B)
+       (#xce6 . ?\e,Hf\e(B)
+       (#xce7 . ?\e,Hg\e(B)
+       (#xce8 . ?\e,Hh\e(B)
+       (#xce9 . ?\e,Hi\e(B)
+       (#xcea . ?\e,Hj\e(B)
+       (#xceb . ?\e,Hk\e(B)
+       (#xcec . ?\e,Hl\e(B)
+       (#xced . ?\e,Hm\e(B)
+       (#xcee . ?\e,Hn\e(B)
+       (#xcef . ?\e,Ho\e(B)
+       (#xcf0 . ?\e,Hp\e(B)
+       (#xcf1 . ?\e,Hq\e(B)
+       (#xcf2 . ?\e,Hr\e(B)
+       (#xcf3 . ?\e,Hs\e(B)
+       (#xcf4 . ?\e,Ht\e(B)
+       (#xcf5 . ?\e,Hu\e(B)
+       (#xcf6 . ?\e,Hv\e(B)
+       (#xcf7 . ?\e,Hw\e(B)
+       (#xcf8 . ?\e,Hx\e(B)
+       (#xcf9 . ?\e,Hy\e(B)
+       (#xcfa . ?\e,Hz\e(B)
+       ;; Thai
+       (#xda1 . ?\e,T!\e(B)
+       (#xda2 . ?\e,T"\e(B)
+       (#xda3 . ?\e,T#\e(B)
+       (#xda4 . ?\e,T$\e(B)
+       (#xda5 . ?\e,T%\e(B)
+       (#xda6 . ?\e,T&\e(B)
+       (#xda7 . ?\e,T'\e(B)
+       (#xda8 . ?\e,T(\e(B)
+       (#xda9 . ?\e,T)\e(B)
+       (#xdaa . ?\e,T*\e(B)
+       (#xdab . ?\e,T+\e(B)
+       (#xdac . ?\e,T,\e(B)
+       (#xdad . ?\e,T-\e(B)
+       (#xdae . ?\e,T.\e(B)
+       (#xdaf . ?\e,T/\e(B)
+       (#xdb0 . ?\e,T0\e(B)
+       (#xdb1 . ?\e,T1\e(B)
+       (#xdb2 . ?\e,T2\e(B)
+       (#xdb3 . ?\e,T3\e(B)
+       (#xdb4 . ?\e,T4\e(B)
+       (#xdb5 . ?\e,T5\e(B)
+       (#xdb6 . ?\e,T6\e(B)
+       (#xdb7 . ?\e,T7\e(B)
+       (#xdb8 . ?\e,T8\e(B)
+       (#xdb9 . ?\e,T9\e(B)
+       (#xdba . ?\e,T:\e(B)
+       (#xdbb . ?\e,T;\e(B)
+       (#xdbc . ?\e,T<\e(B)
+       (#xdbd . ?\e,T=\e(B)
+       (#xdbe . ?\e,T>\e(B)
+       (#xdbf . ?\e,T?\e(B)
+       (#xdc0 . ?\e,T@\e(B)
+       (#xdc1 . ?\e,TA\e(B)
+       (#xdc2 . ?\e,TB\e(B)
+       (#xdc3 . ?\e,TC\e(B)
+       (#xdc4 . ?\e,TD\e(B)
+       (#xdc5 . ?\e,TE\e(B)
+       (#xdc6 . ?\e,TF\e(B)
+       (#xdc7 . ?\e,TG\e(B)
+       (#xdc8 . ?\e,TH\e(B)
+       (#xdc9 . ?\e,TI\e(B)
+       (#xdca . ?\e,TJ\e(B)
+       (#xdcb . ?\e,TK\e(B)
+       (#xdcc . ?\e,TL\e(B)
+       (#xdcd . ?\e,TM\e(B)
+       (#xdce . ?\e,TN\e(B)
+       (#xdcf . ?\e,TO\e(B)
+       (#xdd0 . ?\e,TP\e(B)
+       (#xdd1 . ?\e,TQ\e(B)
+       (#xdd2 . ?\e,TR\e(B)
+       (#xdd3 . ?\e,TS\e(B)
+       (#xdd4 . ?\e,TT\e(B)
+       (#xdd5 . ?\e,TU\e(B)
+       (#xdd6 . ?\e,TV\e(B)
+       (#xdd7 . ?\e,TW\e(B)
+       (#xdd8 . ?\e,TX\e(B)
+       (#xdd9 . ?\e,TY\e(B)
+       (#xdda . ?\e,TZ\e(B)
+       (#xddf . ?\e,T_\e(B)
+       (#xde0 . ?\e,T`\e(B)
+       (#xde1 . ?\e,Ta\e(B)
+       (#xde2 . ?\e,Tb\e(B)
+       (#xde3 . ?\e,Tc\e(B)
+       (#xde4 . ?\e,Td\e(B)
+       (#xde5 . ?\e,Te\e(B)
+       (#xde6 . ?\e,Tf\e(B)
+       (#xde7 . ?\e,Tg\e(B)
+       (#xde8 . ?\e,Th\e(B)
+       (#xde9 . ?\e,Ti\e(B)
+       (#xdea . ?\e,Tj\e(B)
+       (#xdeb . ?\e,Tk\e(B)
+       (#xdec . ?\e,Tl\e(B)
+       (#xded . ?\e,Tm\e(B)
+       (#xdf0 . ?\e,Tp\e(B)
+       (#xdf1 . ?\e,Tq\e(B)
+       (#xdf2 . ?\e,Tr\e(B)
+       (#xdf3 . ?\e,Ts\e(B)
+       (#xdf4 . ?\e,Tt\e(B)
+       (#xdf5 . ?\e,Tu\e(B)
+       (#xdf6 . ?\e,Tv\e(B)
+       (#xdf7 . ?\e,Tw\e(B)
+       (#xdf8 . ?\e,Tx\e(B)
+       (#xdf9 . ?\e,Ty\e(B)
+       ;; Korean
+       (#xea1 . ?\e$(C$!\e(B)
+       (#xea2 . ?\e$(C$"\e(B)
+       (#xea3 . ?\e$(C$#\e(B)
+       (#xea4 . ?\e$(C$$\e(B)
+       (#xea5 . ?\e$(C$%\e(B)
+       (#xea6 . ?\e$(C$&\e(B)
+       (#xea7 . ?\e$(C$'\e(B)
+       (#xea8 . ?\e$(C$(\e(B)
+       (#xea9 . ?\e$(C$)\e(B)
+       (#xeaa . ?\e$(C$*\e(B)
+       (#xeab . ?\e$(C$+\e(B)
+       (#xeac . ?\e$(C$,\e(B)
+       (#xead . ?\e$(C$-\e(B)
+       (#xeae . ?\e$(C$.\e(B)
+       (#xeaf . ?\e$(C$/\e(B)
+       (#xeb0 . ?\e$(C$0\e(B)
+       (#xeb1 . ?\e$(C$1\e(B)
+       (#xeb2 . ?\e$(C$2\e(B)
+       (#xeb3 . ?\e$(C$3\e(B)
+       (#xeb4 . ?\e$(C$4\e(B)
+       (#xeb5 . ?\e$(C$5\e(B)
+       (#xeb6 . ?\e$(C$6\e(B)
+       (#xeb7 . ?\e$(C$7\e(B)
+       (#xeb8 . ?\e$(C$8\e(B)
+       (#xeb9 . ?\e$(C$9\e(B)
+       (#xeba . ?\e$(C$:\e(B)
+       (#xebb . ?\e$(C$;\e(B)
+       (#xebc . ?\e$(C$<\e(B)
+       (#xebd . ?\e$(C$=\e(B)
+       (#xebe . ?\e$(C$>\e(B)
+       (#xebf . ?\e$(C$?\e(B)
+       (#xec0 . ?\e$(C$@\e(B)
+       (#xec1 . ?\e$(C$A\e(B)
+       (#xec2 . ?\e$(C$B\e(B)
+       (#xec3 . ?\e$(C$C\e(B)
+       (#xec4 . ?\e$(C$D\e(B)
+       (#xec5 . ?\e$(C$E\e(B)
+       (#xec6 . ?\e$(C$F\e(B)
+       (#xec7 . ?\e$(C$G\e(B)
+       (#xec8 . ?\e$(C$H\e(B)
+       (#xec9 . ?\e$(C$I\e(B)
+       (#xeca . ?\e$(C$J\e(B)
+       (#xecb . ?\e$(C$K\e(B)
+       (#xecc . ?\e$(C$L\e(B)
+       (#xecd . ?\e$(C$M\e(B)
+       (#xece . ?\e$(C$N\e(B)
+       (#xecf . ?\e$(C$O\e(B)
+       (#xed0 . ?\e$(C$P\e(B)
+       (#xed1 . ?\e$(C$Q\e(B)
+       (#xed2 . ?\e$(C$R\e(B)
+       (#xed3 . ?\e$(C$S\e(B)
+       (#xed4 . ?\e$,1LH\e(B)
+       (#xed5 . ?\e$,1LI\e(B)
+       (#xed6 . ?\e$,1LJ\e(B)
+       (#xed7 . ?\e$,1LK\e(B)
+       (#xed8 . ?\e$,1LL\e(B)
+       (#xed9 . ?\e$,1LM\e(B)
+       (#xeda . ?\e$,1LN\e(B)
+       (#xedb . ?\e$,1LO\e(B)
+       (#xedc . ?\e$,1LP\e(B)
+       (#xedd . ?\e$,1LQ\e(B)
+       (#xede . ?\e$,1LR\e(B)
+       (#xedf . ?\e$,1LS\e(B)
+       (#xee0 . ?\e$,1LT\e(B)
+       (#xee1 . ?\e$,1LU\e(B)
+       (#xee2 . ?\e$,1LV\e(B)
+       (#xee3 . ?\e$,1LW\e(B)
+       (#xee4 . ?\e$,1LX\e(B)
+       (#xee5 . ?\e$,1LY\e(B)
+       (#xee6 . ?\e$,1LZ\e(B)
+       (#xee7 . ?\e$,1L[\e(B)
+       (#xee8 . ?\e$,1L\\e(B)
+       (#xee9 . ?\e$,1L]\e(B)
+       (#xeea . ?\e$,1L^\e(B)
+       (#xeeb . ?\e$,1L_\e(B)
+       (#xeec . ?\e$,1L`\e(B)
+       (#xeed . ?\e$,1La\e(B)
+       (#xeee . ?\e$,1Lb\e(B)
+       (#xeef . ?\e$(C$]\e(B)
+       (#xef0 . ?\e$(C$a\e(B)
+       (#xef1 . ?\e$(C$h\e(B)
+       (#xef2 . ?\e$(C$o\e(B)
+       (#xef3 . ?\e$(C$q\e(B)
+       (#xef4 . ?\e$(C$t\e(B)
+       (#xef5 . ?\e$(C$v\e(B)
+       (#xef6 . ?\e$(C$}\e(B)
+       (#xef7 . ?\e$(C$~\e(B)
+       (#xef8 . ?\e$,1M+\e(B)
+       (#xef9 . ?\e$,1M0\e(B)
+       (#xefa . ?\e$,1M9\e(B)
+       (#xeff . ?\e$,1tI\e(B)
+       ;; Latin-5
+       ;; Latin-6
+       ;; Latin-7
+       ;; Latin-8
+       ;; Latin-9
+       (#x13bc . ?\e,b<\e(B)
+       (#x13bd . ?\e,b=\e(B)
+       (#x13be . ?\e,b>\e(B)
+       ;; Currency
+       (#x20a0 . ?\e$,1t@\e(B)
+       (#x20a1 . ?\e$,1tA\e(B)
+       (#x20a2 . ?\e$,1tB\e(B)
+       (#x20a3 . ?\e$,1tC\e(B)
+       (#x20a4 . ?\e$,1tD\e(B)
+       (#x20a5 . ?\e$,1tE\e(B)
+       (#x20a6 . ?\e$,1tF\e(B)
+       (#x20a7 . ?\e$,1tG\e(B)
+       (#x20a8 . ?\e$,1tH\e(B)
+       (#x20aa . ?\e$,1tJ\e(B)
+       (#x20ab . ?\e$,1tK\e(B)
+       (#x20ac . ?\e,b$\e(B)))
   (puthash (car pair) (cdr pair) x-keysym-table))
 
 ;; The following keysym codes for graphics are listed in the document
@@ -1997,8 +2085,18 @@ as returned by (x-server-vendor)."
 
 ;;; We keep track of the last text selected here, so we can check the
 ;;; current selection against it, and avoid passing back our own text
-;;; from x-cut-buffer-or-selection-value.
-(defvar x-last-selected-text nil)
+;;; from x-cut-buffer-or-selection-value.  We track all three
+;;; seperately in case another X application only sets one of them
+;;; (say the cut buffer) we aren't fooled by the PRIMARY or
+;;; CLIPBOARD selection staying the same.
+(defvar x-last-selected-text-clipboard nil
+  "The value of the CLIPBOARD X selection last time we selected or
+pasted text.")
+(defvar x-last-selected-text-primary nil
+  "The value of the PRIMARY X selection last time we selected or
+pasted text.")
+(defvar x-last-selected-text-cut nil
+  "The value of the X cut buffer last time we selected or pasted text.")
 
 ;;; It is said that overlarge strings are slow to put into the cut buffer.
 ;;; Note this value is overridden below.
@@ -2019,56 +2117,216 @@ This is in addition to, but in preference to, the primary selection."
 (defun x-select-text (text &optional push)
   ;; Don't send the cut buffer too much text.
   ;; It becomes slow, and if really big it causes errors.
-  (if (< (length text) x-cut-buffer-max)
-      (x-set-cut-buffer text push)
-    (x-set-cut-buffer "" push))
+  (cond ((>= (length text) x-cut-buffer-max)
+        (x-set-cut-buffer "" push)
+        (setq x-last-selected-text-cut ""))
+       ;; Don't store a multibyte string that contains
+       ;; eight-bit-control/graphic chars because they can't be
+       ;; restored correctly by x-get-cut-buffer.
+       ((and (multibyte-string-p text)
+             (let ((charsets (find-charset-string text)))
+               (or (memq 'eight-bit-control charsets)
+                   (memq 'eight-bit-graphic charsets))))
+        (x-set-cut-buffer "" push)
+        (setq x-last-selected-text-cut ""))
+       (t
+        (x-set-cut-buffer text push)
+        (setq x-last-selected-text-cut text)))
   (x-set-selection 'PRIMARY text)
-  (if x-select-enable-clipboard
-      (x-set-selection 'CLIPBOARD text))
-  (setq x-last-selected-text text))
+  (setq x-last-selected-text-primary text)
+  (when x-select-enable-clipboard
+    (x-set-selection 'CLIPBOARD text)
+    (setq x-last-selected-text-clipboard text))
+  )
+
+(defvar x-select-request-type nil
+  "*Data type request for X selection.
+The value is nil, one of the following data types, or a list of them:
+  `COMPOUND_TEXT', `UTF8_STRING', `STRING', `TEXT'
 
+If the value is nil, try `COMPOUND_TEXT' and `UTF8_STRING', and
+use the more appropriate result.  If both fail, try `STRING', and
+then `TEXT'.
+
+If the value is one of the above symbols, try only the specified
+type.
+
+If the value is a list of them, try each of them in the specified
+order until succeed.")
+
+;; Helper function for x-selection-value.  Select UTF8 or CTEXT
+;; whichever is more appropriate.  Here, we use this heurisitcs.
+;;
+;;   (1) If their lengthes are different, select the longer one.  This
+;;   is because an X client may just cut off unsupported characters.
+;;
+;;   (2) Otherwise, if the Nth character of CTEXT is an ASCII
+;;   character that is different from the Nth character of UTF8,
+;;   select UTF8.  This is because an X client may replace unsupported
+;;   characters with some ASCII character (typically ` ' or `?') in
+;;   CTEXT.
+;;
+;;   (3) Otherwise, select CTEXT.  This is because legacy charsets are
+;;   better for the current Emacs, especially when the selection owner
+;;   is also Emacs.
+
+(defun x-select-utf8-or-ctext (utf8 ctext)
+  (let ((len-utf8 (length utf8))
+       (len-ctext (length ctext))
+       (selected ctext)
+       (i 0)
+       char)
+    (if (/= len-utf8 len-ctext)
+       (if (> len-utf8 len-ctext) utf8 ctext)
+      (while (< i len-utf8)
+       (setq char (aref ctext i))
+       (if (and (< char 128) (/= char (aref utf8 i)))
+           (setq selected utf8
+                 i len-utf8)
+         (setq i (1+ i))))
+      selected)))
+
+(defun x-selection-value (type)
+  (let (text)
+    (cond ((null x-select-request-type)
+          (let (utf8 ctext utf8-coding)
+            ;; We try both UTF8_STRING and COMPOUND_TEXT, and choose
+            ;; the more appropriate one.  If both fail, try STRING.
+
+            ;; At first try UTF8_STRING.
+            (setq utf8 (condition-case nil
+                           (x-get-selection type 'UTF8_STRING)
+                         (error nil))
+                  utf8-coding last-coding-system-used)
+            (if utf8
+                ;; If it is a locale selection, choose it.
+                (or (get-text-property 0 'foreign-selection utf8)
+                    (setq text utf8)))
+            ;; If not yet decided, try COMPOUND_TEXT.
+            (if (not text)
+                (if (setq ctext (condition-case nil
+                                    (x-get-selection type 'COMPOUND_TEXT)
+                                  (error nil)))
+                    ;; If UTF8_STRING was also successful, choose the
+                    ;; more appropriate one from UTF8 and CTEXT.
+                    (if utf8
+                        (setq text (x-select-utf8-or-ctext utf8 ctext))
+                      ;; Othewise, choose CTEXT.
+                      (setq text ctext))))
+            ;; If not yet decided, try STRING.
+            (or text
+                (setq text (condition-case nil
+                               (x-get-selection type 'STRING)
+                             (error nil))))
+            (if (eq text utf8)
+                (setq last-coding-system-used utf8-coding))))
+
+         ((consp x-select-request-type)
+          (let ((tail x-select-request-type))
+            (while (and tail (not text))
+              (condition-case nil
+                  (setq text (x-get-selection type (car tail)))
+                (error nil))
+              (setq tail (cdr tail)))))
+
+         (t
+          (condition-case nil
+              (setq text (x-get-selection type x-select-request-type))
+            (error nil))))
+
+    (if text
+       (remove-text-properties 0 (length text) '(foreign-selection nil) text))
+    text))
+      
 ;;; Return the value of the current X selection.
-;;; Consult the selection, then the cut buffer.  Treat empty strings
+;;; Consult the selection, and the cut buffer.  Treat empty strings
 ;;; as if they were unset.
 ;;; If this function is called twice and finds the same text,
 ;;; it returns nil the second time.  This is so that a single
 ;;; selection won't be added to the kill ring over and over.
 (defun x-cut-buffer-or-selection-value ()
-  (let (text)
+  (let (clip-text primary-text cut-text)
     (when x-select-enable-clipboard
-      (if (null text) 
-         (condition-case c
-             (setq text (x-get-selection 'CLIPBOARD 'COMPOUND_TEXT))
-           (error nil)))
-      (if (null text) 
-         (condition-case c
-             (setq text (x-get-selection 'CLIPBOARD 'STRING))
-           (error nil)))
-      (if (string= text "") (setq text nil)))
-
-    ;; Don't die if x-get-selection signals an error.
-    (if (null text) 
-       (condition-case c
-           (setq text (x-get-selection 'PRIMARY 'COMPOUND_TEXT))
-         (error nil)))
-    (if (null text) 
-       (condition-case c
-           (setq text (x-get-selection 'PRIMARY 'STRING))
-         (error nil)))
-    (if (string= text "") (setq text nil))
-
-    (or text (setq text (x-get-cut-buffer 0)))
-    (if (string= text "") (setq text nil))
-
-    (cond
-     ((not text) nil)
-     ((eq text x-last-selected-text) nil)
-     ((string= text x-last-selected-text)
-      ;; Record the newer string, so subsequent calls can use the `eq' test.
-      (setq x-last-selected-text text)
+      (setq clip-text (x-selection-value 'CLIPBOARD))
+      (if (string= clip-text "") (setq clip-text nil))
+
+      ;; Check the CLIPBOARD selection for 'newness', is it different
+      ;; from what we remebered them to be last time we did a
+      ;; cut/paste operation.
+      (setq clip-text
+           (cond;; check clipboard
+            ((or (not clip-text) (string= clip-text ""))
+             (setq x-last-selected-text-clipboard nil))
+            ((eq      clip-text x-last-selected-text-clipboard) nil)
+            ((string= clip-text x-last-selected-text-clipboard)
+             ;; Record the newer string,
+             ;; so subsequent calls can use the `eq' test.
+             (setq x-last-selected-text-clipboard clip-text)
+             nil)
+            (t
+             (setq x-last-selected-text-clipboard clip-text))))
+      )
+
+    (setq primary-text (x-selection-value 'PRIMARY))
+    ;; Check the PRIMARY selection for 'newness', is it different
+    ;; from what we remebered them to be last time we did a
+    ;; cut/paste operation.
+    (setq primary-text
+         (cond;; check primary selection
+          ((or (not primary-text) (string= primary-text ""))
+           (setq x-last-selected-text-primary nil))
+          ((eq      primary-text x-last-selected-text-primary) nil)
+          ((string= primary-text x-last-selected-text-primary)
+           ;; Record the newer string,
+           ;; so subsequent calls can use the `eq' test.
+           (setq x-last-selected-text-primary primary-text)
+           nil)
+          (t
+           (setq x-last-selected-text-primary primary-text))))
+
+    (setq cut-text (x-get-cut-buffer 0))
+
+    ;; Check the x cut buffer for 'newness', is it different
+    ;; from what we remebered them to be last time we did a
+    ;; cut/paste operation.
+    (setq cut-text
+         (cond;; check primary selection
+          ((or (not cut-text) (string= cut-text ""))
+           (setq x-last-selected-text-cut nil))
+          ((eq      cut-text x-last-selected-text-cut) nil)
+          ((string= cut-text x-last-selected-text-cut)
+           ;; Record the newer string,
+           ;; so subsequent calls can use the `eq' test.
+           (setq x-last-selected-text-cut cut-text)
       nil)
      (t
-      (setq x-last-selected-text text)))))
+           (setq x-last-selected-text-cut cut-text))))
+
+    ;; As we have done one selection, clear this now.
+    (setq next-selection-coding-system nil)
+
+    ;; At this point we have recorded the current values for the
+    ;; selection from clipboard (if we are supposed to) primary,
+    ;; and cut buffer.  So return the first one that has changed
+    ;; (which is the first non-null one).
+    ;;
+    ;; NOTE: There will be cases where more than one of these has
+    ;; changed and the new values differ.  This indicates that
+    ;; something like the following has happened since the last time
+    ;; we looked at the selections: Application X set all the
+    ;; selections, then Application Y set only one or two of them (say
+    ;; just the cut-buffer).  In this case since we don't have
+    ;; timestamps there is no way to know what the 'correct' value to
+    ;; return is.  The nice thing to do would be to tell the user we
+    ;; saw multiple possible selections and ask the user which was the
+    ;; one they wanted.
+    ;; This code is still a big improvement because now the user can
+    ;; futz with the current selection and get emacs to pay attention
+    ;; to the cut buffer again (previously as soon as clipboard or
+    ;; primary had been set the cut buffer would essentially never be
+    ;; checked again).
+    (or clip-text primary-text cut-text)
+    ))
 
 \f
 ;;; Do the actual X Windows setup here; the above code just defines
@@ -2097,6 +2355,9 @@ This is in addition to, but in preference to, the primary selection."
 (setq x-cut-buffer-max (min (- (/ (x-server-max-request-size) 2) 100)
                            x-cut-buffer-max))
 
+;; Setup the default fontset.
+(setup-default-fontset)
+
 ;; Create the standard fontset.
 (create-fontset-from-fontset-spec standard-fontset-spec t)
 
@@ -2150,7 +2411,7 @@ This is in addition to, but in preference to, the primary selection."
       (setq x-selection-timeout (string-to-number res-selection-timeout))))
 
 (defun x-win-suspend-error ()
-  (error "Suspending an emacs running under X makes no sense"))
+  (error "Suspending an Emacs running under X makes no sense"))
 (add-hook 'suspend-hook 'x-win-suspend-error)
 
 ;;; Arrange for the kill and yank functions to set and check the clipboard.
@@ -2164,11 +2425,14 @@ This is in addition to, but in preference to, the primary selection."
 ;; Don't show the frame name; that's redundant with X.
 (setq-default mode-line-frame-identification "  ")
 
-;;; Motif direct handling of f10 wasn't working right,
-;;; So temporarily we've turned it off in lwlib-Xm.c
-;;; and turned the Emacs f10 back on.
-;;; ;; Motif normally handles f10 itself, so don't try to handle it a second time.
-;;; (if (featurep 'motif)
-;;;     (global-set-key [f10] 'ignore))
+;; Motif direct handling of f10 wasn't working right,
+;; So temporarily we've turned it off in lwlib-Xm.c
+;; and turned the Emacs f10 back on.
+;; ;; Motif normally handles f10 itself, so don't try to handle it a second time.
+;; (if (featurep 'motif)
+;;     (global-set-key [f10] 'ignore))
+
+;; Turn on support for mouse wheels.
+(mouse-wheel-mode 1)
 
 ;;; x-win.el ends here