1 ;;; mew-mule.el --- Environment of Mule common for Mew
3 ;; Author: Kazu Yamamoto <Kazu@Mew.org>
4 ;; Created: Jul 15, 1998
5 ;; Revised: Aug 30, 1999
9 (defconst mew-mule-version "mew-mule.el version 0.03")
12 (require 'mew-lang-jp))
17 (defun mew-charset-guess-string (str)
21 (mew-charset-guess-region (point-min) (point-max))))
23 (defun mew-charset-guess-region (beg end)
24 "Guess minimum charset name."
29 (if (re-search-forward "[\200-\377]" end t)
32 (let* ((tcsl (mew-find-cs-region beg end))
34 (alst mew-cs-database)
35 i a acsl aret csl ret)
40 (setq alst (cdr alst))
44 (if (member (nth i tcsl) acsl)
52 (if (and acsl (< (length acsl) (length csl)))
53 (setq ret aret csl acsl))))
54 (or ret mew-error-charset-unknown))))
56 (defun mew-charset-sanity-check (beg end)
57 "Eliminate illegal characters"
59 (if (and (not (equal mew-mule-ver 0))
60 (member mew-lc-kana (mew-find-cs-region beg end)))
62 (require 'mew-lang-jp)
63 (mew-zenkaku-katakana-region beg end)
64 (message "Converted Hankaku Kana to Zenkaku Kana!!")
68 (defvar mew-charset-list
69 (mapcar (function (lambda (x) (nth 0 x))) mew-cs-database))
71 (defun mew-charset-to-data (charset)
73 (mew-assoc-case-equal charset mew-cs-database 0)))
75 (defun mew-charset-to-cs (charset)
77 (nth 2 (mew-assoc-case-equal charset mew-cs-database 0))))
79 (defun mew-charset-to-cte (charset)
82 (nth 3 (mew-assoc-case-equal charset mew-cs-database 0))))
88 ;; Copyright (C) 1998, 1999 Mew developing team.
89 ;; All rights reserved.
91 ;; Redistribution and use in source and binary forms, with or without
92 ;; modification, are permitted provided that the following conditions
95 ;; 1. Redistributions of source code must retain the above copyright
96 ;; notice, this list of conditions and the following disclaimer.
97 ;; 2. Redistributions in binary form must reproduce the above copyright
98 ;; notice, this list of conditions and the following disclaimer in the
99 ;; documentation and/or other materials provided with the distribution.
100 ;; 3. Neither the name of the team nor the names of its contributors
101 ;; may be used to endorse or promote products derived from this software
102 ;; without specific prior written permission.
104 ;; THIS SOFTWARE IS PROVIDED BY THE TEAM AND CONTRIBUTORS ``AS IS'' AND
105 ;; ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
106 ;; IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
107 ;; PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE TEAM OR CONTRIBUTORS BE
108 ;; LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
109 ;; CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
110 ;; SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
111 ;; BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
112 ;; WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
113 ;; OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
114 ;; IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
116 ;;; mew-mule.el ends here