-(defvar default-mime-charset 'x-ctext)
-
-(defvar mime-charset-coding-system-alist
- '((x-ctext . coding-system-ctext)
- (hz-gb-2312 . coding-system-hz)
- (cn-gb-2312 . coding-system-euc-china)
- (gb2312 . coding-system-euc-china)
- (cn-big5 . coding-system-big5)
- (iso-2022-jp-2 . coding-system-iso-2022-ss2-7)
- (iso-2022-int-1 . coding-system-iso-2022-int)
- (shift_jis . coding-system-sjis)
- ))
-
-(defun mime-charset-to-coding-system (charset &optional lbt)
- (if (stringp charset)
- (setq charset (intern (downcase charset)))
- )
- (let ((cs
- (or (cdr (assq charset mime-charset-coding-system-alist))
- (let ((cs (intern (concat "coding-system-"
- (symbol-name charset)))))
- (and (coding-system-p cs) cs)
- ))))
- (if lbt
- (intern (concat (symbol-name cs) "-" (symbol-name lbt)))
- cs)))
-
-(defun detect-mime-charset-region (start end)
- "Return MIME charset for region between START and END. [emu-e20.el]"
- (charsets-to-mime-charset
- (find-charset-string (buffer-substring start end))
- ))
-
-(defun encode-mime-charset-region (start end charset)
- "Encode the text between START and END as MIME CHARSET. [emu-e20.el]"
- (let ((cs (mime-charset-to-coding-system charset)))
- (if cs
- (encode-coding-region start end cs)
- )))
-
-(defun decode-mime-charset-region (start end charset)
- "Decode the text between START and END as MIME CHARSET. [emu-e20.el]"
- (let ((cs (mime-charset-to-coding-system charset)))
- (if cs
- (decode-coding-region start end cs)
- )))
-
-(defun encode-mime-charset-string (string charset)
- "Encode the STRING as MIME CHARSET. [emu-e20.el]"
- (let ((cs (mime-charset-to-coding-system charset)))
- (if cs
- (encode-coding-string string cs)
- string)))
-
-(defun decode-mime-charset-string (string charset)
- "Decode the STRING as MIME CHARSET. [emu-e20.el]"
- (let ((cs (mime-charset-to-coding-system charset)))
- (if cs
- (decode-coding-string string cs)
- string)))
-